Module one.jpro.platform.auth.core
Package one.jpro.platform.auth.core.jwt
Class JWTAuthenticationProvider
java.lang.Object
one.jpro.platform.auth.core.jwt.JWTAuthenticationProvider
- All Implemented Interfaces:
AuthenticationProvider<TokenCredentials>
public class JWTAuthenticationProvider
extends Object
implements AuthenticationProvider<TokenCredentials>
JSON Web Token authentication provider.
-
Constructor Summary
ConstructorsConstructorDescriptionJWTAuthenticationProvider(@NotNull JWTAuthOptions authOptions) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(@NotNull TokenCredentials credentials) Authenticates the givenTokenCredentialsand returns a user.Retrieves the token from the given token path and authentication info.
-
Constructor Details
-
JWTAuthenticationProvider
Default constructor.- Parameters:
authOptions- the authentication options
-
-
Method Details
-
token
public CompletableFuture<TokenCredentials> token(@NotNull @NotNull String tokenPath, @NotNull @NotNull org.json.JSONObject authInfo) Retrieves the token from the given token path and authentication info.- Parameters:
tokenPath- the token pathauthInfo- the authentication info- Returns:
- a
CompletableFutureholding the token credentials
-
authenticate
Authenticates the givenTokenCredentialsand returns a user.- Specified by:
authenticatein interfaceAuthenticationProvider<TokenCredentials>- Parameters:
credentials- token credentials containing the information for authenticating the user.- Returns:
- a
CompletableFutureholding theUserobject.
-