providers/proxy: add initial header token auth (#4421)
* initial implementation Signed-off-by: Jens Langhammer <jens@goauthentik.io> * check for openid/profile claims Signed-off-by: Jens Langhammer <jens@goauthentik.io> * include jwks sources in proxy provider Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add web ui for jwks Signed-off-by: Jens Langhammer <jens@goauthentik.io> * only show sources with JWKS data configured Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix introspection tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * start basic Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add basic auth Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add docs, update admonitions Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add client_id to api, add tab for auth Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update locale Signed-off-by: Jens Langhammer <jens@goauthentik.io> Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
		| @ -31,6 +31,7 @@ import { | ||||
|     ProvidersApi, | ||||
|     ProxyMode, | ||||
|     ProxyProvider, | ||||
|     SourcesApi, | ||||
| } from "@goauthentik/api"; | ||||
|  | ||||
| @customElement("ak-provider-proxy-form") | ||||
| @ -385,7 +386,10 @@ export class ProxyProviderFormPage extends ModelForm<ProxyProvider, number> { | ||||
|                         > | ||||
|                         </ak-search-select> | ||||
|                     </ak-form-element-horizontal> | ||||
|                     <ak-form-element-horizontal label=${t`Scopes`} name="propertyMappings"> | ||||
|                     <ak-form-element-horizontal | ||||
|                         label=${t`Additional scopes`} | ||||
|                         name="propertyMappings" | ||||
|                     > | ||||
|                         <select class="pf-c-form-control" multiple> | ||||
|                             ${until( | ||||
|                                 new PropertymappingsApi(DEFAULT_CONFIG) | ||||
| @ -440,7 +444,11 @@ ${this.instance?.skipPathRegex}</textarea | ||||
|                             ${t`When using proxy or forward auth (single application) mode, the requested URL Path is checked against the regular expressions. When using forward auth (domain mode), the full requested URL including scheme and host is matched against the regular expressions.`} | ||||
|                         </p> | ||||
|                     </ak-form-element-horizontal> | ||||
|  | ||||
|                 </div> | ||||
|             </ak-form-group> | ||||
|             <ak-form-group> | ||||
|                 <span slot="header">${t`Authentication settings`}</span> | ||||
|                 <div slot="body" class="pf-c-form"> | ||||
|                     <ak-form-element-horizontal name="basicAuthEnabled"> | ||||
|                         <label class="pf-c-switch"> | ||||
|                             <input | ||||
| @ -458,14 +466,47 @@ ${this.instance?.skipPathRegex}</textarea | ||||
|                                 </span> | ||||
|                             </span> | ||||
|                             <span class="pf-c-switch__label" | ||||
|                                 >${t`Set HTTP-Basic Authentication`}</span | ||||
|                                 >${t`Send HTTP-Basic Authentication`}</span | ||||
|                             > | ||||
|                         </label> | ||||
|                         <p class="pf-c-form__helper-text"> | ||||
|                             ${t`Set a custom HTTP-Basic Authentication header based on values from authentik.`} | ||||
|                             ${t`Send a custom HTTP-Basic Authentication header based on values from authentik.`} | ||||
|                         </p> | ||||
|                     </ak-form-element-horizontal> | ||||
|                     ${this.showHttpBasic ? this.renderHttpBasic() : html``} | ||||
|                     <ak-form-element-horizontal label=${t`Trusted OIDC Sources`} name="jwksSources"> | ||||
|                         <select class="pf-c-form-control" multiple> | ||||
|                             ${until( | ||||
|                                 new SourcesApi(DEFAULT_CONFIG) | ||||
|                                     .sourcesOauthList({ | ||||
|                                         ordering: "name", | ||||
|                                         hasJwks: true, | ||||
|                                     }) | ||||
|                                     .then((sources) => { | ||||
|                                         return sources.results.map((source) => { | ||||
|                                             const selected = ( | ||||
|                                                 this.instance?.jwksSources || [] | ||||
|                                             ).some((su) => { | ||||
|                                                 return su == source.pk; | ||||
|                                             }); | ||||
|                                             return html`<option | ||||
|                                                 value=${source.pk} | ||||
|                                                 ?selected=${selected} | ||||
|                                             > | ||||
|                                                 ${source.name} (${source.slug}) | ||||
|                                             </option>`; | ||||
|                                         }); | ||||
|                                     }), | ||||
|                                 html`<option>${t`Loading...`}</option>`, | ||||
|                             )} | ||||
|                         </select> | ||||
|                         <p class="pf-c-form__helper-text"> | ||||
|                             ${t`JWTs signed by certificates configured in the selected sources can be used to authenticate to this provider.`} | ||||
|                         </p> | ||||
|                         <p class="pf-c-form__helper-text"> | ||||
|                             ${t`Hold control/command to select multiple items.`} | ||||
|                         </p> | ||||
|                     </ak-form-element-horizontal> | ||||
|                 </div> | ||||
|             </ak-form-group> | ||||
|         </form>`; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens L
					Jens L