Class OauthClientConfigurationProperties
java.lang.Object
io.micronaut.security.oauth2.configuration.OauthClientConfigurationProperties
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
,OauthClientConfiguration
@Context
@EachProperty("micronaut.security.oauth2.clients")
public class OauthClientConfigurationProperties
extends Object
implements OauthClientConfiguration
Stores configuration of each configured OAuth 2.0 client.
- Since:
- 1.2.0
- Author:
- James Kleeh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
OAuth 2.0 authorization endpoint configuration.static class
Client credentials configuration.static class
Introspection endpoint configuration.static class
OpenID client configuration.static class
Revocation endpoint configuration.static class
OAuth 2.0 token endpoint configuration. -
Field Summary
FieldsFields inherited from interface io.micronaut.security.oauth2.configuration.OauthClientConfiguration
DEFAULT_ADVANCED_EXPIRATION, DEFAULT_AUTH_METHOD, DEFAULT_AUTHENTICATION_METHOD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable AuthorizationServer
@NonNull Optional<ClientCredentialsConfiguration>
@NonNull String
@Nullable String
@NonNull GrantType
@NonNull String
getName()
getToken()
boolean
boolean
boolean
void
setAuthorization
(OauthClientConfigurationProperties.AuthorizationEndpointConfigurationProperties authorization) The OAuth 2.0 authorization endpoint configuration.void
setAuthorizationServer
(@Nullable AuthorizationServer authorizationServer) Micronaut attempts to infer the authorization server used by the client based on the issuer.void
setClientCredentials
(@NonNull OauthClientConfigurationProperties.ClientCredentialsConfigurationProperties clientCredentials) Sets the Client Credentials configuration.void
setClientId
(@NonNull String clientId) OAuth 2.0 client id.void
setClientSecret
(@Nullable String clientSecret) OAuth 2.0 client secret.void
setEnabled
(boolean enabled) Sets whether the client is enabled.void
setGrantType
(@NonNull GrantType grantType) OAuth 2.0 grant type.void
setIntrospection
(OauthClientConfigurationProperties.IntrospectionEndpointConfigurationProperties introspection) Sets the introspection endpoint configuration.void
The open id configuration.void
setProxyWellKnownOauthAuthorizationServer
(boolean proxyWellKnownOauthAuthorizationServer) Whether a request to /.well-known/oauth-authorization-server should be proxied to the authorization server.void
setProxyWellKnownOpenidConfiguration
(boolean proxyWellKnownOpenidConfiguration) Whether a request to /.well-known/openid-configuration should be proxied to the authorization server.void
setRevocation
(OauthClientConfigurationProperties.RevocationEndpointConfigurationProperties revocation) Sets the revocation endpoint configuration.void
Requested scopes.void
The OAuth 2.0 token endpoint configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.security.oauth2.configuration.OauthClientConfiguration
getTokenEndpoint
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
-
Constructor Details
-
OauthClientConfigurationProperties
- Parameters:
name
- The provider name
-
-
Method Details
-
isProxyWellKnownOauthAuthorizationServer
public boolean isProxyWellKnownOauthAuthorizationServer()- Specified by:
isProxyWellKnownOauthAuthorizationServer
in interfaceOauthClientConfiguration
- Returns:
- Whether a request to /.well-known/oauth-authorization-server should be proxied to the authorization server.
-
setProxyWellKnownOauthAuthorizationServer
public void setProxyWellKnownOauthAuthorizationServer(boolean proxyWellKnownOauthAuthorizationServer) Whether a request to /.well-known/oauth-authorization-server should be proxied to the authorization server. Default to false.- Parameters:
proxyWellKnownOauthAuthorizationServer
- Whether a request to /.well-known/oauth-authorization-server should be proxied to the authorization server.
-
isProxyWellKnownOpenidConfiguration
public boolean isProxyWellKnownOpenidConfiguration()- Specified by:
isProxyWellKnownOpenidConfiguration
in interfaceOauthClientConfiguration
- Returns:
- Whether a request to /.well-known/openid-configuration should be proxied to the authorization server.
-
setProxyWellKnownOpenidConfiguration
public void setProxyWellKnownOpenidConfiguration(boolean proxyWellKnownOpenidConfiguration) Whether a request to /.well-known/openid-configuration should be proxied to the authorization server. Default to false.- Parameters:
proxyWellKnownOpenidConfiguration
- Whether a request to /.well-known/openid-configuration should be proxied to the authorization server.
-
setAuthorizationServer
Micronaut attempts to infer the authorization server used by the client based on the issuer. However, if you are using a custom domain, it may be impossible to infer it. You can set it explicitly via this property.- Parameters:
authorizationServer
- The authorization server
-
getAuthorizationServer
- Specified by:
getAuthorizationServer
in interfaceOauthClientConfiguration
- Returns:
- The
AuthorizationServer
used by the OAuth Client.
-
getClientId
- Specified by:
getClientId
in interfaceOauthClientConfiguration
- Returns:
- The client id
-
setClientId
OAuth 2.0 client id.- Parameters:
clientId
- The client id
-
getClientSecret
- Specified by:
getClientSecret
in interfaceOauthClientConfiguration
- Returns:
- The client secret
-
setClientSecret
OAuth 2.0 client secret.- Parameters:
clientSecret
- The client secret
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Sets whether the client is enabled. Default value (true).- Parameters:
enabled
- The enabled flag
-
getScopes
- Specified by:
getScopes
in interfaceOauthClientConfiguration
- Returns:
- The scopes requested
-
setScopes
Requested scopes. If not specified for OAuth 2.0 clients using OpenID Connect it defaults to `profile`, `email` and `idtoken`- Parameters:
scopes
- The scopes
-
getName
- Specified by:
getName
in interfaceOauthClientConfiguration
- Returns:
- The provider name
-
getGrantType
- Specified by:
getGrantType
in interfaceOauthClientConfiguration
- Returns:
- The grant type
-
setGrantType
OAuth 2.0 grant type. Default value (authorization_code).- Parameters:
grantType
- The grant type
-
getToken
- Specified by:
getToken
in interfaceOauthClientConfiguration
- Returns:
- The optional token endpoint configuration
- See Also:
-
setToken
The OAuth 2.0 token endpoint configuration.- Parameters:
token
- The token endpoint configuration
-
getAuthorization
- Specified by:
getAuthorization
in interfaceOauthClientConfiguration
- Returns:
- The optional authorization endpoint configuration
- See Also:
-
getClientCredentials
- Specified by:
getClientCredentials
in interfaceOauthClientConfiguration
- Returns:
- The Client Credentials Configuration
-
setClientCredentials
public void setClientCredentials(@NonNull @NonNull OauthClientConfigurationProperties.ClientCredentialsConfigurationProperties clientCredentials) Sets the Client Credentials configuration.- Parameters:
clientCredentials
- client credentials configuration
-
setAuthorization
public void setAuthorization(OauthClientConfigurationProperties.AuthorizationEndpointConfigurationProperties authorization) The OAuth 2.0 authorization endpoint configuration.- Parameters:
authorization
- The authorization endpoint configuration
-
getOpenid
- Specified by:
getOpenid
in interfaceOauthClientConfiguration
- Returns:
- The open id configuration
-
setOpenid
public void setOpenid(OauthClientConfigurationProperties.OpenIdClientConfigurationProperties openid) The open id configuration.- Parameters:
openid
- The open id configuration
-
getIntrospection
- Specified by:
getIntrospection
in interfaceOauthClientConfiguration
- Returns:
- The introspection endpoint configuration
- See Also:
-
setIntrospection
public void setIntrospection(OauthClientConfigurationProperties.IntrospectionEndpointConfigurationProperties introspection) Sets the introspection endpoint configuration.- Parameters:
introspection
- The introspection endpoint configuration
-
getRevocation
- Specified by:
getRevocation
in interfaceOauthClientConfiguration
- Returns:
- The revocation endpoint configuration
- See Also:
-
setRevocation
public void setRevocation(OauthClientConfigurationProperties.RevocationEndpointConfigurationProperties revocation) Sets the revocation endpoint configuration.- Parameters:
revocation
- The revocation endpoint configuration
-