Class OpenIdConfiguration
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.security.openid.OpenIdConfiguration
- All Implemented Interfaces:
org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
public class OpenIdConfiguration
extends org.eclipse.jetty.util.component.ContainerLifeCycle
Holds the configuration for an OpenID Connect service.
This uses the OpenID Provider URL with the path CONFIG_PATH to discover
the required information about the OIDC service.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Dumpable.DumpAppendableNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
LEGEND -
Constructor Summary
ConstructorsConstructorDescriptionOpenIdConfiguration(String provider, String clientId, String clientSecret) Deprecated, for removal: This API element is subject to removal in a future version.OpenIdConfiguration(String issuer, String authorizationEndpoint, String tokenEndpoint, String endSessionEndpoint, String clientId, String clientSecret, String authenticationMethod, org.eclipse.jetty.client.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead.OpenIdConfiguration(String issuer, String authorizationEndpoint, String tokenEndpoint, String clientId, String clientSecret, String authenticationMethod, org.eclipse.jetty.client.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead.OpenIdConfiguration(String issuer, String authorizationEndpoint, String tokenEndpoint, String clientId, String clientSecret, org.eclipse.jetty.client.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.useOpenIdConfiguration.Builderto configure the OpenID Configuration.protected voiddoStart()Obtain the JSON metadata from OpenID Connect Discovery Configuration Endpoint.Deprecated, for removal: This API element is subject to removal in a future version.usegetAuthorizationEndpoint()instead.org.eclipse.jetty.client.HttpClientbooleanbooleanprotected voidprocessMetadata(Map<String, Object> discoveryDocument) Process the OpenID Connect metadata discovered byfetchOpenIdConnectMetadata().voidsetAuthenticateNewUsers(boolean authenticateNewUsers) Deprecated, for removal: This API element is subject to removal in a future version.useOpenIdConfiguration.Builderto configure the OpenID Configuration.voidsetLogoutWhenIdTokenIsExpired(boolean logoutWhenIdTokenIsExpired) Deprecated, for removal: This API element is subject to removal in a future version.useOpenIdConfiguration.Builderto configure the OpenID Configuration.toString()Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
OpenIdConfiguration
@Deprecated(since="12.1.0", forRemoval=true) public OpenIdConfiguration(String provider, String clientId, String clientSecret) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead.Create an OpenID configuration for a specific OIDC provider.- Parameters:
provider- The URL of the OpenID provider.clientId- OAuth 2.0 Client Identifier valid at the Authorization Server.clientSecret- The client secret known only by the Client and the Authorization Server.
-
OpenIdConfiguration
@Deprecated(since="12.1.0", forRemoval=true) public OpenIdConfiguration(String issuer, String authorizationEndpoint, String tokenEndpoint, String clientId, String clientSecret, org.eclipse.jetty.client.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead.Create an OpenID configuration for a specific OIDC provider.- Parameters:
issuer- The URL of the OpenID provider.authorizationEndpoint- the URL of the OpenID provider's authorization endpoint if configured.tokenEndpoint- the URL of the OpenID provider's token endpoint if configured.clientId- OAuth 2.0 Client Identifier valid at the Authorization Server.clientSecret- The client secret known only by the Client and the Authorization Server.httpClient- TheHttpClientinstance to use.
-
OpenIdConfiguration
@Deprecated(since="12.1.0", forRemoval=true) public OpenIdConfiguration(@Name("issuer") String issuer, @Name("authorizationEndpoint") String authorizationEndpoint, @Name("tokenEndpoint") String tokenEndpoint, @Name("clientId") String clientId, @Name("clientSecret") String clientSecret, @Name("authenticationMethod") String authenticationMethod, @Name("httpClient") org.eclipse.jetty.client.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead.Create an OpenID configuration for a specific OIDC provider.- Parameters:
issuer- The URL of the OpenID provider.authorizationEndpoint- the URL of the OpenID provider's authorization endpoint if configured.tokenEndpoint- the URL of the OpenID provider's token endpoint if configured.clientId- OAuth 2.0 Client Identifier valid at the Authorization Server.clientSecret- The client secret known only by the Client and the Authorization Server.authenticationMethod- Authentication method to use with the Token Endpoint.httpClient- TheHttpClientinstance to use.
-
OpenIdConfiguration
@Deprecated(since="12.1.0", forRemoval=true) public OpenIdConfiguration(@Name("issuer") String issuer, @Name("authorizationEndpoint") String authorizationEndpoint, @Name("tokenEndpoint") String tokenEndpoint, @Name("endSessionEndpoint") String endSessionEndpoint, @Name("clientId") String clientId, @Name("clientSecret") String clientSecret, @Name("authenticationMethod") String authenticationMethod, @Name("httpClient") org.eclipse.jetty.client.HttpClient httpClient) Deprecated, for removal: This API element is subject to removal in a future version.UseOpenIdConfiguration.Builderinstead.Create an OpenID configuration for a specific OIDC provider.- Parameters:
issuer- The URL of the OpenID provider.authorizationEndpoint- the URL of the OpenID provider's authorization endpoint if configured.tokenEndpoint- the URL of the OpenID provider's token endpoint if configured.endSessionEndpoint- the URL of the OpenID provider's end session endpoint if configured.clientId- OAuth 2.0 Client Identifier valid at the Authorization Server.clientSecret- The client secret known only by the Client and the Authorization Server.authenticationMethod- Authentication method to use with the Token Endpoint.httpClient- TheHttpClientinstance to use.
-
-
Method Details
-
doStart
-
processMetadata
Process the OpenID Connect metadata discovered byfetchOpenIdConnectMetadata(). By default, only theAUTHORIZATION_ENDPOINTandTOKEN_ENDPOINTclaims are extracted.- Throws:
IllegalStateException- if a required field is not present in the metadata.- See Also:
-
fetchOpenIdConnectMetadata
Obtain the JSON metadata from OpenID Connect Discovery Configuration Endpoint.- Returns:
- a set of Claims about the OpenID Provider's configuration in JSON format.
- Throws:
IllegalStateException- if metadata could not be fetched from the OP.
-
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient() -
getAuthorizationEndpoint
-
getClientId
-
getClientSecret
-
getIssuer
-
getTokenEndpoint
-
getEndSessionEndpoint
-
getAuthenticationMethod
-
getScopes
-
isAuthenticateNewUsers
public boolean isAuthenticateNewUsers() -
isLogoutWhenIdTokenIsExpired
public boolean isLogoutWhenIdTokenIsExpired() -
getAuthEndpoint
Deprecated, for removal: This API element is subject to removal in a future version.usegetAuthorizationEndpoint()instead. -
setAuthenticateNewUsers
@Deprecated(since="12.1.0", forRemoval=true) public void setAuthenticateNewUsers(boolean authenticateNewUsers) Deprecated, for removal: This API element is subject to removal in a future version.useOpenIdConfiguration.Builderto configure the OpenID Configuration. -
addScopes
Deprecated, for removal: This API element is subject to removal in a future version.useOpenIdConfiguration.Builderto configure the OpenID Configuration. -
setLogoutWhenIdTokenIsExpired
@Deprecated(since="12.1.0", forRemoval=true) public void setLogoutWhenIdTokenIsExpired(boolean logoutWhenIdTokenIsExpired) Deprecated, for removal: This API element is subject to removal in a future version.useOpenIdConfiguration.Builderto configure the OpenID Configuration. -
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-
OpenIdConfiguration.Builderinstead.