|
15 | 15 | */
|
16 | 16 | package org.springframework.security.oauth2.core;
|
17 | 17 |
|
| 18 | +import org.springframework.security.oauth2.core.oidc.OidcProviderConfiguration; |
| 19 | +import org.springframework.security.oauth2.core.oidc.OidcProviderMetadataClaimNames; |
18 | 20 | import java.io.Serializable;
|
19 | 21 | import java.net.URI;
|
20 | 22 | import java.net.URL;
|
|
33 | 35 | * The metadata endpoint returns a set of claims an Authorization Server describes about its configuration.
|
34 | 36 | *
|
35 | 37 | * @author Daniel Garnier-Moiroux
|
| 38 | + * @author Arthur Mita |
36 | 39 | * @see OAuth2AuthorizationServerMetadataClaimAccessor
|
37 |
| - * @since 0.1.1 |
38 | 40 | * @see <a target="_blank" href="https://tools.ietf.org/html/rfc8414#section-3.2">3.2. Authorization Server Metadata Response</a>
|
39 | 41 | * @see <a target="_blank" href="https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse">4.2. OpenID Provider Configuration Response</a>
|
| 42 | + * @since 0.1.1 |
40 | 43 | */
|
41 | 44 | public abstract class AbstractOAuth2AuthorizationServerMetadata implements OAuth2AuthorizationServerMetadataClaimAccessor, Serializable {
|
42 | 45 | private static final long serialVersionUID = Version.SERIAL_VERSION_UID;
|
@@ -73,7 +76,7 @@ protected Map<String, Object> getClaims() {
|
73 | 76 | @SuppressWarnings("unchecked")
|
74 | 77 | protected final B getThis() {
|
75 | 78 | return (B) this; // avoid unchecked casts in subclasses by using "getThis()" instead of "(B) this"
|
76 |
| - }; |
| 79 | + } |
77 | 80 |
|
78 | 81 | /**
|
79 | 82 | * Use this {@code issuer} in the resulting {@link AbstractOAuth2AuthorizationServerMetadata}, REQUIRED.
|
@@ -105,6 +108,16 @@ public B tokenEndpoint(String tokenEndpoint) {
|
105 | 108 | return claim(OAuth2AuthorizationServerMetadataClaimNames.TOKEN_ENDPOINT, tokenEndpoint);
|
106 | 109 | }
|
107 | 110 |
|
| 111 | + /** |
| 112 | + * Add this registration endpoint in the resulting {@link OidcProviderConfiguration} OPTIONAL |
| 113 | + * |
| 114 | + * @param registrationEndpoint the supported registration client url |
| 115 | + * @return the {@link OidcProviderConfiguration.Builder} for further configuration |
| 116 | + */ |
| 117 | + public B clientRegistrationEndpoint(String registrationEndpoint) { |
| 118 | + return claim(OAuth2AuthorizationServerMetadataClaimNames.REGISTRATION_ENDPOINT, registrationEndpoint); |
| 119 | + } |
| 120 | + |
108 | 121 | /**
|
109 | 122 | * Add this client authentication method to the collection of {@code token_endpoint_auth_methods_supported}
|
110 | 123 | * in the resulting {@link AbstractOAuth2AuthorizationServerMetadata}, OPTIONAL.
|
@@ -299,7 +312,7 @@ public B codeChallengeMethods(Consumer<List<String>> codeChallengeMethodsConsume
|
299 | 312 | /**
|
300 | 313 | * Use this claim in the resulting {@link AbstractOAuth2AuthorizationServerMetadata}.
|
301 | 314 | *
|
302 |
| - * @param name the claim name |
| 315 | + * @param name the claim name |
303 | 316 | * @param value the claim value
|
304 | 317 | * @return the {@link AbstractBuilder} for further configuration
|
305 | 318 | */
|
|
0 commit comments