sources/oauth: make URLs not required, only check when no OIDC URLs are defined (#9182)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -130,7 +130,13 @@ class OAuthSourceSerializer(SourceSerializer):
|
||||
"oidc_jwks_url",
|
||||
"oidc_jwks",
|
||||
]
|
||||
extra_kwargs = {"consumer_secret": {"write_only": True}}
|
||||
extra_kwargs = {
|
||||
"consumer_secret": {"write_only": True},
|
||||
"request_token_url": {"allow_blank": True},
|
||||
"authorization_url": {"allow_blank": True},
|
||||
"access_token_url": {"allow_blank": True},
|
||||
"profile_url": {"allow_blank": True},
|
||||
}
|
||||
|
||||
|
||||
class OAuthSourceFilter(FilterSet):
|
||||
|
@ -4547,7 +4547,6 @@
|
||||
"null"
|
||||
],
|
||||
"maxLength": 255,
|
||||
"minLength": 1,
|
||||
"title": "Request Token URL",
|
||||
"description": "URL used to request the initial token. This URL is only required for OAuth 1."
|
||||
},
|
||||
@ -4557,7 +4556,6 @@
|
||||
"null"
|
||||
],
|
||||
"maxLength": 255,
|
||||
"minLength": 1,
|
||||
"title": "Authorization URL",
|
||||
"description": "URL the user is redirect to to conest the flow."
|
||||
},
|
||||
@ -4567,7 +4565,6 @@
|
||||
"null"
|
||||
],
|
||||
"maxLength": 255,
|
||||
"minLength": 1,
|
||||
"title": "Access Token URL",
|
||||
"description": "URL used by authentik to retrieve tokens."
|
||||
},
|
||||
@ -4577,7 +4574,6 @@
|
||||
"null"
|
||||
],
|
||||
"maxLength": 255,
|
||||
"minLength": 1,
|
||||
"title": "Profile URL",
|
||||
"description": "URL used by authentik to get user information."
|
||||
},
|
||||
@ -5782,7 +5778,8 @@
|
||||
"device_type_restrictions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"title": "Device type restrictions"
|
||||
}
|
||||
|
@ -35551,26 +35551,22 @@ components:
|
||||
request_token_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL used to request the initial token. This URL is only required
|
||||
for OAuth 1.
|
||||
maxLength: 255
|
||||
authorization_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL the user is redirect to to conest the flow.
|
||||
maxLength: 255
|
||||
access_token_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL used by authentik to retrieve tokens.
|
||||
maxLength: 255
|
||||
profile_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL used by authentik to get user information.
|
||||
maxLength: 255
|
||||
consumer_key:
|
||||
@ -38563,26 +38559,22 @@ components:
|
||||
request_token_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL used to request the initial token. This URL is only required
|
||||
for OAuth 1.
|
||||
maxLength: 255
|
||||
authorization_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL the user is redirect to to conest the flow.
|
||||
maxLength: 255
|
||||
access_token_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL used by authentik to retrieve tokens.
|
||||
maxLength: 255
|
||||
profile_url:
|
||||
type: string
|
||||
nullable: true
|
||||
minLength: 1
|
||||
description: URL used by authentik to get user information.
|
||||
maxLength: 255
|
||||
consumer_key:
|
||||
|
@ -108,7 +108,6 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal
|
||||
label=${msg("Authorization URL")}
|
||||
?required=${true}
|
||||
name="authorizationUrl"
|
||||
>
|
||||
<input
|
||||
@ -119,17 +118,12 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
"",
|
||||
)}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
<p class="pf-c-form__helper-text">
|
||||
${msg("URL the user is redirect to to consent the authorization.")}
|
||||
</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${msg("Access token URL")}
|
||||
?required=${true}
|
||||
name="accessTokenUrl"
|
||||
>
|
||||
<ak-form-element-horizontal label=${msg("Access token URL")} name="accessTokenUrl">
|
||||
<input
|
||||
type="text"
|
||||
value="${first(
|
||||
@ -138,17 +132,12 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
"",
|
||||
)}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
<p class="pf-c-form__helper-text">
|
||||
${msg("URL used by authentik to retrieve tokens.")}
|
||||
</p>
|
||||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal
|
||||
label=${msg("Profile URL")}
|
||||
?required=${true}
|
||||
name="profileUrl"
|
||||
>
|
||||
<ak-form-element-horizontal label=${msg("Profile URL")} name="profileUrl">
|
||||
<input
|
||||
type="text"
|
||||
value="${first(
|
||||
@ -157,7 +146,6 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
"",
|
||||
)}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
<p class="pf-c-form__helper-text">
|
||||
${msg("URL used by authentik to get user information.")}
|
||||
|
Reference in New Issue
Block a user