providers/oauth2: add JWKS URL to OAuth2ProviderSetupURLs

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-06-07 20:17:06 +02:00
parent 7d84a71a01
commit 23023ec727
13 changed files with 74 additions and 0 deletions

View file

@ -48,6 +48,7 @@ class OAuth2ProviderSetupURLs(PassiveSerializer):
user_info = CharField(read_only=True) user_info = CharField(read_only=True)
provider_info = CharField(read_only=True) provider_info = CharField(read_only=True)
logout = CharField(read_only=True) logout = CharField(read_only=True)
jwks = CharField(read_only=True)
class OAuth2ProviderViewSet(UsedByMixin, ModelViewSet): class OAuth2ProviderViewSet(UsedByMixin, ModelViewSet):
@ -119,6 +120,12 @@ class OAuth2ProviderViewSet(UsedByMixin, ModelViewSet):
kwargs={"application_slug": provider.application.slug}, kwargs={"application_slug": provider.application.slug},
) )
) )
data["jwks"] = request.build_absolute_uri(
reverse(
"authentik_providers_oauth2:jwks",
kwargs={"application_slug": provider.application.slug},
)
)
except Provider.application.RelatedObjectDoesNotExist: # pylint: disable=no-member except Provider.application.RelatedObjectDoesNotExist: # pylint: disable=no-member
pass pass
return Response(data) return Response(data)

View file

@ -23367,9 +23367,13 @@ components:
logout: logout:
type: string type: string
readOnly: true readOnly: true
jwks:
type: string
readOnly: true
required: required:
- authorize - authorize
- issuer - issuer
- jwks
- logout - logout
- provider_info - provider_info
- token - token

View file

@ -62,6 +62,7 @@ msgstr "(Format: hours=-1;minutes=-2;seconds=-3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2745,6 +2746,10 @@ msgstr "Ausstellermodus"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "JWT Algorithmus" #~ msgstr "JWT Algorithmus"

View file

@ -46,6 +46,7 @@ msgstr "(Format: hours=1;minutes=2;seconds=3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2794,6 +2795,10 @@ msgstr "Issuer mode"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgstr "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr "JWKS URL"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "JWT Algorithm" #~ msgstr "JWT Algorithm"

View file

@ -49,6 +49,7 @@ msgstr "(Formato: horas = 1; minutos = 2; segundos = 3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2738,6 +2739,10 @@ msgstr "Modo emisor"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "algoritmo JWT" #~ msgstr "algoritmo JWT"

View file

@ -52,6 +52,7 @@ msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2767,6 +2768,10 @@ msgstr "Mode de l'émetteur"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "Algorithme JWT" #~ msgstr "Algorithme JWT"

View file

@ -49,6 +49,7 @@ msgstr "(Format: hours=1;minutes=2;seconds=3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2735,6 +2736,10 @@ msgstr "Tryb wystawcy"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "Algorytm JWT" #~ msgstr "Algorytm JWT"

View file

@ -46,6 +46,7 @@ msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2776,6 +2777,10 @@ msgstr ""
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "" #~ msgstr ""

View file

@ -49,6 +49,7 @@ msgstr "(Biçim: saat=1; dakika=2; saniye= 3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2739,6 +2740,10 @@ msgstr "Yayımcı kipi"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "JWT Algoritması" #~ msgstr "JWT Algoritması"

View file

@ -50,6 +50,7 @@ msgstr "格式hours=1;minutes=2;seconds=3。"
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2723,6 +2724,10 @@ msgstr "Issuer 模式"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "JSON Web Key URL。来自此 URL 的 Key 将被用于验证此身份来源的 JWT。" msgstr "JSON Web Key URL。来自此 URL 的 Key 将被用于验证此身份来源的 JWT。"
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "JWT 算法" #~ msgstr "JWT 算法"

View file

@ -51,6 +51,7 @@ msgstr "(格式: hours=1;minutes=2;seconds=3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2726,6 +2727,10 @@ msgstr "Issuer mode"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "JWT 算法" #~ msgstr "JWT 算法"

View file

@ -51,6 +51,7 @@ msgstr "(格式: hours=1;minutes=2;seconds=3)."
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/stages/invitation/InvitationListPage.ts #: src/pages/stages/invitation/InvitationListPage.ts
#: src/pages/tokens/TokenListPage.ts #: src/pages/tokens/TokenListPage.ts
#: src/pages/users/RelatedUserList.ts #: src/pages/users/RelatedUserList.ts
@ -2726,6 +2727,10 @@ msgstr "Issuer mode"
msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source." msgid "JSON Web Key URL. Keys from the URL will be used to validate JWTs from this source."
msgstr "" msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
msgid "JWKS URL"
msgstr ""
#~ msgid "JWT Algorithm" #~ msgid "JWT Algorithm"
#~ msgstr "JWT 算法" #~ msgstr "JWT 算法"

View file

@ -256,6 +256,19 @@ export class OAuth2ProviderViewPage extends LitElement {
value="${this.providerUrls?.logout || t`-`}" value="${this.providerUrls?.logout || t`-`}"
/> />
</div> </div>
<div class="pf-c-form__group">
<label class="pf-c-form__label">
<span class="pf-c-form__label-text"
>${t`JWKS URL`}</span
>
</label>
<input
class="pf-c-form-control"
readonly
type="text"
value="${this.providerUrls?.jwks || t`-`}"
/>
</div>
</form> </form>
</div> </div>
</div> </div>