|
@@ -20,90 +20,90 @@ import java.util.Map;
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
/**
|
|
|
- * A facility for provider configuration settings.
|
|
|
+ * A facility for authorization server configuration settings.
|
|
|
*
|
|
|
* @author Daniel Garnier-Moiroux
|
|
|
* @author Joe Grandja
|
|
|
* @since 0.1.0
|
|
|
* @see AbstractSettings
|
|
|
- * @see ConfigurationSettingNames.Provider
|
|
|
+ * @see ConfigurationSettingNames.AuthorizationServer
|
|
|
*/
|
|
|
-public final class ProviderSettings extends AbstractSettings {
|
|
|
+public final class AuthorizationServerSettings extends AbstractSettings {
|
|
|
|
|
|
- private ProviderSettings(Map<String, Object> settings) {
|
|
|
+ private AuthorizationServerSettings(Map<String, Object> settings) {
|
|
|
super(settings);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the URL of the Provider's Issuer Identifier
|
|
|
+ * Returns the URL of the Authorization Server's Issuer Identifier
|
|
|
*
|
|
|
- * @return the URL of the Provider's Issuer Identifier
|
|
|
+ * @return the URL of the Authorization Server's Issuer Identifier
|
|
|
*/
|
|
|
public String getIssuer() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.ISSUER);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.ISSUER);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's OAuth 2.0 Authorization endpoint. The default is {@code /oauth2/authorize}.
|
|
|
+ * Returns the OAuth 2.0 Authorization endpoint. The default is {@code /oauth2/authorize}.
|
|
|
*
|
|
|
* @return the Authorization endpoint
|
|
|
*/
|
|
|
public String getAuthorizationEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.AUTHORIZATION_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.AUTHORIZATION_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's OAuth 2.0 Token endpoint. The default is {@code /oauth2/token}.
|
|
|
+ * Returns the OAuth 2.0 Token endpoint. The default is {@code /oauth2/token}.
|
|
|
*
|
|
|
* @return the Token endpoint
|
|
|
*/
|
|
|
public String getTokenEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.TOKEN_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.TOKEN_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's JWK Set endpoint. The default is {@code /oauth2/jwks}.
|
|
|
+ * Returns the JWK Set endpoint. The default is {@code /oauth2/jwks}.
|
|
|
*
|
|
|
* @return the JWK Set endpoint
|
|
|
*/
|
|
|
public String getJwkSetEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.JWK_SET_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.JWK_SET_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's OAuth 2.0 Token Revocation endpoint. The default is {@code /oauth2/revoke}.
|
|
|
+ * Returns the OAuth 2.0 Token Revocation endpoint. The default is {@code /oauth2/revoke}.
|
|
|
*
|
|
|
* @return the Token Revocation endpoint
|
|
|
*/
|
|
|
public String getTokenRevocationEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.TOKEN_REVOCATION_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.TOKEN_REVOCATION_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's OAuth 2.0 Token Introspection endpoint. The default is {@code /oauth2/introspect}.
|
|
|
+ * Returns the OAuth 2.0 Token Introspection endpoint. The default is {@code /oauth2/introspect}.
|
|
|
*
|
|
|
* @return the Token Introspection endpoint
|
|
|
*/
|
|
|
public String getTokenIntrospectionEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.TOKEN_INTROSPECTION_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.TOKEN_INTROSPECTION_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's OpenID Connect 1.0 Client Registration endpoint. The default is {@code /connect/register}.
|
|
|
+ * Returns the OpenID Connect 1.0 Client Registration endpoint. The default is {@code /connect/register}.
|
|
|
*
|
|
|
* @return the OpenID Connect 1.0 Client Registration endpoint
|
|
|
*/
|
|
|
public String getOidcClientRegistrationEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.OIDC_CLIENT_REGISTRATION_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.OIDC_CLIENT_REGISTRATION_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns the Provider's OpenID Connect 1.0 UserInfo endpoint. The default is {@code /userinfo}.
|
|
|
+ * Returns the OpenID Connect 1.0 UserInfo endpoint. The default is {@code /userinfo}.
|
|
|
*
|
|
|
* @return the OpenID Connect 1.0 UserInfo endpoint
|
|
|
*/
|
|
|
public String getOidcUserInfoEndpoint() {
|
|
|
- return getSetting(ConfigurationSettingNames.Provider.OIDC_USER_INFO_ENDPOINT);
|
|
|
+ return getSetting(ConfigurationSettingNames.AuthorizationServer.OIDC_USER_INFO_ENDPOINT);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -135,101 +135,101 @@ public final class ProviderSettings extends AbstractSettings {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * A builder for {@link ProviderSettings}.
|
|
|
+ * A builder for {@link AuthorizationServerSettings}.
|
|
|
*/
|
|
|
- public final static class Builder extends AbstractBuilder<ProviderSettings, Builder> {
|
|
|
+ public final static class Builder extends AbstractBuilder<AuthorizationServerSettings, Builder> {
|
|
|
|
|
|
private Builder() {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the URL the Provider uses as its Issuer Identifier.
|
|
|
+ * Sets the URL the Authorization Server uses as its Issuer Identifier.
|
|
|
*
|
|
|
- * @param issuer the URL the Provider uses as its Issuer Identifier.
|
|
|
+ * @param issuer the URL the Authorization Server uses as its Issuer Identifier.
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder issuer(String issuer) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.ISSUER, issuer);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.ISSUER, issuer);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's OAuth 2.0 Authorization endpoint.
|
|
|
+ * Sets the OAuth 2.0 Authorization endpoint.
|
|
|
*
|
|
|
* @param authorizationEndpoint the Authorization endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder authorizationEndpoint(String authorizationEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.AUTHORIZATION_ENDPOINT, authorizationEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.AUTHORIZATION_ENDPOINT, authorizationEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's OAuth 2.0 Token endpoint.
|
|
|
+ * Sets the OAuth 2.0 Token endpoint.
|
|
|
*
|
|
|
* @param tokenEndpoint the Token endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder tokenEndpoint(String tokenEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.TOKEN_ENDPOINT, tokenEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.TOKEN_ENDPOINT, tokenEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's JWK Set endpoint.
|
|
|
+ * Sets the JWK Set endpoint.
|
|
|
*
|
|
|
* @param jwkSetEndpoint the JWK Set endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder jwkSetEndpoint(String jwkSetEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.JWK_SET_ENDPOINT, jwkSetEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.JWK_SET_ENDPOINT, jwkSetEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's OAuth 2.0 Token Revocation endpoint.
|
|
|
+ * Sets the OAuth 2.0 Token Revocation endpoint.
|
|
|
*
|
|
|
* @param tokenRevocationEndpoint the Token Revocation endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder tokenRevocationEndpoint(String tokenRevocationEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.TOKEN_REVOCATION_ENDPOINT, tokenRevocationEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.TOKEN_REVOCATION_ENDPOINT, tokenRevocationEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's OAuth 2.0 Token Introspection endpoint.
|
|
|
+ * Sets the OAuth 2.0 Token Introspection endpoint.
|
|
|
*
|
|
|
* @param tokenIntrospectionEndpoint the Token Introspection endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder tokenIntrospectionEndpoint(String tokenIntrospectionEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.TOKEN_INTROSPECTION_ENDPOINT, tokenIntrospectionEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.TOKEN_INTROSPECTION_ENDPOINT, tokenIntrospectionEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's OpenID Connect 1.0 Client Registration endpoint.
|
|
|
+ * Sets the OpenID Connect 1.0 Client Registration endpoint.
|
|
|
*
|
|
|
* @param oidcClientRegistrationEndpoint the OpenID Connect 1.0 Client Registration endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder oidcClientRegistrationEndpoint(String oidcClientRegistrationEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.OIDC_CLIENT_REGISTRATION_ENDPOINT, oidcClientRegistrationEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.OIDC_CLIENT_REGISTRATION_ENDPOINT, oidcClientRegistrationEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Sets the Provider's OpenID Connect 1.0 UserInfo endpoint.
|
|
|
+ * Sets the OpenID Connect 1.0 UserInfo endpoint.
|
|
|
*
|
|
|
* @param oidcUserInfoEndpoint the OpenID Connect 1.0 UserInfo endpoint
|
|
|
* @return the {@link Builder} for further configuration
|
|
|
*/
|
|
|
public Builder oidcUserInfoEndpoint(String oidcUserInfoEndpoint) {
|
|
|
- return setting(ConfigurationSettingNames.Provider.OIDC_USER_INFO_ENDPOINT, oidcUserInfoEndpoint);
|
|
|
+ return setting(ConfigurationSettingNames.AuthorizationServer.OIDC_USER_INFO_ENDPOINT, oidcUserInfoEndpoint);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Builds the {@link ProviderSettings}.
|
|
|
+ * Builds the {@link AuthorizationServerSettings}.
|
|
|
*
|
|
|
- * @return the {@link ProviderSettings}
|
|
|
+ * @return the {@link AuthorizationServerSettings}
|
|
|
*/
|
|
|
@Override
|
|
|
- public ProviderSettings build() {
|
|
|
- return new ProviderSettings(getSettings());
|
|
|
+ public AuthorizationServerSettings build() {
|
|
|
+ return new AuthorizationServerSettings(getSettings());
|
|
|
}
|
|
|
|
|
|
}
|