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 java.lang.Object implements OauthClientConfiguration
Stores configuration of each configured OAuth 2.0 client.- Since:
- 1.2.0
- Author:
- James Kleeh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OauthClientConfigurationProperties.AuthorizationEndpointConfigurationProperties
OAuth 2.0 authorization endpoint configurationstatic class
OauthClientConfigurationProperties.IntrospectionEndpointConfigurationProperties
Introspection endpoint configurationstatic class
OauthClientConfigurationProperties.OpenIdClientConfigurationProperties
OpenID client configuration.static class
OauthClientConfigurationProperties.RevocationEndpointConfigurationProperties
Revocation endpoint configurationstatic class
OauthClientConfigurationProperties.TokenEndpointConfigurationProperties
OAuth 2.0 token endpoint configuration
-
Constructor Summary
Constructors Constructor Description OauthClientConfigurationProperties(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<EndpointConfiguration>
getAuthorization()
https://tools.ietf.org/html/rfc6749#section-3.1java.lang.String
getClientId()
java.lang.String
getClientSecret()
GrantType
getGrantType()
java.util.Optional<SecureEndpointConfiguration>
getIntrospection()
https://tools.ietf.org/html/rfc7662.java.lang.String
getName()
java.util.Optional<OpenIdClientConfiguration>
getOpenid()
java.util.Optional<SecureEndpointConfiguration>
getRevocation()
https://tools.ietf.org/html/rfc7009.java.util.List<java.lang.String>
getScopes()
java.util.Optional<SecureEndpointConfiguration>
getToken()
https://tools.ietf.org/html/rfc6749#section-4.1.3boolean
isEnabled()
void
setAuthorization(OauthClientConfigurationProperties.AuthorizationEndpointConfigurationProperties authorization)
The OAuth 2.0 authorization endpoint configurationvoid
setClientId(java.lang.String clientId)
OAuth 2.0 client id.void
setClientSecret(java.lang.String clientSecret)
OAuth 2.0 client secret.void
setEnabled(boolean enabled)
Sets whether the client is enabled.void
setGrantType(GrantType grantType)
OAuth 2.0 grant type.void
setIntrospection(OauthClientConfigurationProperties.IntrospectionEndpointConfigurationProperties introspection)
Sets the introspection endpoint configuration.void
setOpenid(OauthClientConfigurationProperties.OpenIdClientConfigurationProperties openid)
The open id configuration.void
setRevocation(OauthClientConfigurationProperties.RevocationEndpointConfigurationProperties revocation)
Sets the revocation endpoint configuration.void
setScopes(java.util.List<java.lang.String> scopes)
The scopes to request.void
setToken(OauthClientConfigurationProperties.TokenEndpointConfigurationProperties token)
The OAuth 2.0 token endpoint configuration
-
-
-
Method Detail
-
getClientId
@Nonnull public java.lang.String getClientId()
- Specified by:
getClientId
in interfaceOauthClientConfiguration
- Returns:
- The client id
-
setClientId
public void setClientId(@Nonnull java.lang.String clientId)
OAuth 2.0 client id.- Parameters:
clientId
- The client id
-
getClientSecret
@Nullable public java.lang.String getClientSecret()
- Specified by:
getClientSecret
in interfaceOauthClientConfiguration
- Returns:
- The client secret
-
setClientSecret
public void setClientSecret(@Nullable java.lang.String clientSecret)
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
@Nonnull public java.util.List<java.lang.String> getScopes()
- Specified by:
getScopes
in interfaceOauthClientConfiguration
- Returns:
- The scopes requested
-
setScopes
public void setScopes(java.util.List<java.lang.String> scopes)
The scopes to request.- Parameters:
scopes
- The scopes
-
getName
@Nonnull public java.lang.String getName()
- Specified by:
getName
in interfaceOauthClientConfiguration
- Returns:
- The provider name
-
getGrantType
@Nonnull public GrantType getGrantType()
- Specified by:
getGrantType
in interfaceOauthClientConfiguration
- Returns:
- The grant type
-
setGrantType
public void setGrantType(@Nonnull GrantType grantType)
OAuth 2.0 grant type. Default value (authorization_code).- Parameters:
grantType
- The grant type
-
getToken
public java.util.Optional<SecureEndpointConfiguration> getToken()
Description copied from interface:OauthClientConfiguration
https://tools.ietf.org/html/rfc6749#section-4.1.3- Specified by:
getToken
in interfaceOauthClientConfiguration
- Returns:
- The optional token endpoint configuration
-
setToken
public void setToken(OauthClientConfigurationProperties.TokenEndpointConfigurationProperties token)
The OAuth 2.0 token endpoint configuration- Parameters:
token
- The token endpoint configuration
-
getAuthorization
public java.util.Optional<EndpointConfiguration> getAuthorization()
Description copied from interface:OauthClientConfiguration
https://tools.ietf.org/html/rfc6749#section-3.1- Specified by:
getAuthorization
in interfaceOauthClientConfiguration
- Returns:
- The optional authorization endpoint configuration
-
setAuthorization
public void setAuthorization(OauthClientConfigurationProperties.AuthorizationEndpointConfigurationProperties authorization)
The OAuth 2.0 authorization endpoint configuration- Parameters:
authorization
- The authorization endpoint configuration
-
getOpenid
public java.util.Optional<OpenIdClientConfiguration> 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
public java.util.Optional<SecureEndpointConfiguration> getIntrospection()
Description copied from interface:OauthClientConfiguration
https://tools.ietf.org/html/rfc7662.- Specified by:
getIntrospection
in interfaceOauthClientConfiguration
- Returns:
- The introspection endpoint configuration
-
setIntrospection
public void setIntrospection(OauthClientConfigurationProperties.IntrospectionEndpointConfigurationProperties introspection)
Sets the introspection endpoint configuration.- Parameters:
introspection
- The introspection endpoint configuration
-
getRevocation
public java.util.Optional<SecureEndpointConfiguration> getRevocation()
Description copied from interface:OauthClientConfiguration
https://tools.ietf.org/html/rfc7009.- Specified by:
getRevocation
in interfaceOauthClientConfiguration
- Returns:
- The revocation endpoint configuration
-
setRevocation
public void setRevocation(OauthClientConfigurationProperties.RevocationEndpointConfigurationProperties revocation)
Sets the revocation endpoint configuration.- Parameters:
revocation
- The revocation endpoint configuration
-
-