Package com.ocient.auth
Class OpenIDAuthenticators.AuthorizationCodeWithPKCEClient
java.lang.Object
com.ocient.auth.OpenIDAuthenticators.AuthorizationCodeWithPKCEClient
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- OpenIDAuthenticators
public static class OpenIDAuthenticators.AuthorizationCodeWithPKCEClient extends Object implements Closeable
The PKCE-enhanced Authorization Code Flow introduces a secret created by the
calling application that can be verified by the authorization server; this
secret is called the Code Verifier. Additionally, the calling app creates a
transform value of the Code Verifier called the Code Challenge and sends this
value over HTTPS to retrieve an Authorization Code. This way, a malicious
attacker can only intercept the Authorization Code, and they cannot exchange
it for a token without the Code Verifier.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<T extends Token>The authorization code is obtained by using an authorization server as an intermediary between the client and resource owner. -
Constructor Summary
Constructors Constructor Description AuthorizationCodeWithPKCEClient(String host, int port, boolean debugMode) -
Method Summary
Modifier and Type Method Description voidclose()Stops the server, waiting up to 10 seconds for running requests to completeOpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OpenIDAuthenticators.OAuthToken>create(ClientWireProtocol.OpenIDAuthenticator authenticator)OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OpenIDAuthenticators.OAuthToken>create(ClientWireProtocol.OpenIDAuthenticator authenticator, Map<String,String> additionalParameters)Begins the OAuth 2.0 Authorization Code w/ PKCE Flowvoidstart()Binds the server to the port provided to the constructor
-
Constructor Details
-
Method Details
-
start
Binds the server to the port provided to the constructor- Throws:
IOException
-
close
public void close()Stops the server, waiting up to 10 seconds for running requests to complete- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
create
public OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OpenIDAuthenticators.OAuthToken> create(ClientWireProtocol.OpenIDAuthenticator authenticator) throws Exception- Throws:
Exception
-
create
public OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant<OpenIDAuthenticators.OAuthToken> create(ClientWireProtocol.OpenIDAuthenticator authenticator, Map<String,String> additionalParameters) throws ExceptionBegins the OAuth 2.0 Authorization Code w/ PKCE Flow- Parameters:
authenticator- the Authorization Server- Returns:
- an
OpenIDAuthenticators.AuthorizationCodeWithPKCEClient.AuthorizationCodeGrant - Throws:
Exception- when any exception occurs
-