Class OAuth2Authenticator
java.lang.Object
org.frankframework.lifecycle.servlets.AbstractServletAuthenticator
org.frankframework.lifecycle.servlets.OAuth2Authenticator
- All Implemented Interfaces:
IAuthenticator,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
OAuth2 Authentication provider which contains 4 defaults (Google, GitHub,
Facebook and Okta), as well as a custom setting which allows users to
use their own IDP.
Default redirect url is as follows:
{baseUrl}/-servlet-name-/oauth2/code/{registrationId}
{baseUrl} resolves to {baseScheme}://{baseHost}{basePort}{basePath}.
The redirect url has been modified to match the servlet path and is deduced from the default
OAuth2LoginAuthenticationFilter.DEFAULT_FILTER_PROCESSES_URI.
Authentication base URL is: -servlet-name-/oauth2/authorization
This authenticator should be configured by setting its type to 'OAUTH2', for example:
application.security.console.authentication.type=OAUTH2
application.security.console.authentication.provider=google
application.security.console.authentication.clientId=my-client-id
application.security.console.authentication.clientSecret=my-client-secret
- Author:
- Niels Meijer
- See Also:
-
Field Summary
Fields inherited from class org.frankframework.lifecycle.servlets.AbstractServletAuthenticator
ALLOW_OPTIONS_REQUESTS_KEY, DEFAULT_IBIS_ROLES, DEFAULT_ROLE_PREFIX, log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.web.SecurityFilterChainconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Before building, configure the FilterChain.org.springframework.security.oauth2.client.registration.ClientRegistration.BuildercreateCustomBuilder(String name, String registrationId) org.springframework.security.oauth2.client.registration.ClientRegistrationRepositoryprotected org.springframework.security.oauth2.client.registration.ClientRegistrationgetRegistration(String provider, ICredentials credentials) Methods inherited from class org.frankframework.lifecycle.servlets.AbstractServletAuthenticator
build, configureHttpSecurity, getAuthorizationManager, getEnvironmentProperties, getPrivateEndpoints, registerServlet, setApplicationContext
-
Constructor Details
-
OAuth2Authenticator
public OAuth2Authenticator()
-
-
Method Details
-
configure
public org.springframework.security.web.SecurityFilterChain configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception Description copied from class:AbstractServletAuthenticatorBefore building, configure the FilterChain.- Specified by:
configurein classAbstractServletAuthenticator- Throws:
Exception
-
getOrCreateClientRegistrationRepository
public org.springframework.security.oauth2.client.registration.ClientRegistrationRepository getOrCreateClientRegistrationRepository() -
getRegistration
protected org.springframework.security.oauth2.client.registration.ClientRegistration getRegistration(@Nonnull String provider, @Nonnull ICredentials credentials) -
createCustomBuilder
-