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 classOAuth 2.0 authorization endpoint configuration.static classClient credentials configuration.static classIntrospection endpoint configuration.static classOpenID client configuration.static classRevocation endpoint configuration.static classOAuth 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 StringgetName()getToken()booleanbooleanbooleanvoidsetAuthorization(OauthClientConfigurationProperties.AuthorizationEndpointConfigurationProperties authorization) The OAuth 2.0 authorization endpoint configuration.voidsetAuthorizationServer(@Nullable AuthorizationServer authorizationServer) Micronaut attempts to infer the authorization server used by the client based on the issuer.voidsetClientCredentials(@NonNull OauthClientConfigurationProperties.ClientCredentialsConfigurationProperties clientCredentials) Sets the Client Credentials configuration.voidsetClientId(@NonNull String clientId) OAuth 2.0 client id.voidsetClientSecret(@Nullable String clientSecret) OAuth 2.0 client secret.voidsetEnabled(boolean enabled) Sets whether the client is enabled.voidsetGrantType(@NonNull GrantType grantType) OAuth 2.0 grant type.voidsetIntrospection(OauthClientConfigurationProperties.IntrospectionEndpointConfigurationProperties introspection) Sets the introspection endpoint configuration.voidThe open id configuration.voidsetProxyWellKnownOauthAuthorizationServer(boolean proxyWellKnownOauthAuthorizationServer) Whether a request to /.well-known/oauth-authorization-server should be proxied to the authorization server.voidsetProxyWellKnownOpenidConfiguration(boolean proxyWellKnownOpenidConfiguration) Whether a request to /.well-known/openid-configuration should be proxied to the authorization server.voidsetRevocation(OauthClientConfigurationProperties.RevocationEndpointConfigurationProperties revocation) Sets the revocation endpoint configuration.voidRequested scopes.voidThe OAuth 2.0 token endpoint configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
isProxyWellKnownOauthAuthorizationServerin 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:
isProxyWellKnownOpenidConfigurationin 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:
getAuthorizationServerin interfaceOauthClientConfiguration- Returns:
- The
AuthorizationServerused by the OAuth Client.
-
getClientId
- Specified by:
getClientIdin interfaceOauthClientConfiguration- Returns:
- The client id
-
setClientId
OAuth 2.0 client id.- Parameters:
clientId- The client id
-
getClientSecret
- Specified by:
getClientSecretin interfaceOauthClientConfiguration- Returns:
- The client secret
-
setClientSecret
OAuth 2.0 client secret.- Parameters:
clientSecret- The client secret
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin 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:
getScopesin 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:
getNamein interfaceOauthClientConfiguration- Returns:
- The provider name
-
getGrantType
- Specified by:
getGrantTypein interfaceOauthClientConfiguration- Returns:
- The grant type
-
setGrantType
OAuth 2.0 grant type. Default value (authorization_code).- Parameters:
grantType- The grant type
-
getToken
- Specified by:
getTokenin 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:
getAuthorizationin interfaceOauthClientConfiguration- Returns:
- The optional authorization endpoint configuration
- See Also:
-
getClientCredentials
- Specified by:
getClientCredentialsin 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:
getOpenidin 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:
getIntrospectionin 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:
getRevocationin 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
-