public class OAuth2AuthProviderImpl extends Object implements OAuth2Auth
| Constructor and Description |
|---|
OAuth2AuthProviderImpl(Vertx vertx,
OAuth2Options config) |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(Credentials credentials,
Handler<AsyncResult<User>> handler)
Authenticate a user.
|
void |
authenticate(JsonObject authInfo,
Handler<AsyncResult<User>> handler)
Authenticate a user.
|
String |
authorizeURL(JsonObject params)
The client sends the end-user's browser to this endpoint to request their
authentication and consent.
|
OAuth2Auth |
decodeToken(String token,
Handler<AsyncResult<AccessToken>> handler)
Deprecated.
|
String |
endSessionURL(User user,
JsonObject params)
The logout (end-session) endpoint is specified in OpenID Connect Session Management 1.0.
|
OAuth2Options |
getConfig() |
OAuth2FlowType |
getFlowType()
Deprecated.
|
OAuth2Auth |
introspectToken(String token,
String tokenType,
Handler<AsyncResult<AccessToken>> handler)
Deprecated.
|
OAuth2Auth |
jWKSet(Handler<AsyncResult<Void>> handler)
Retrieve the public server JSON Web Key (JWK) required to verify the authenticity
of issued ID and access tokens.
|
OAuth2Auth |
missingKeyHandler(Handler<String> handler)
Handled to be called when a key (mentioned on a JWT) is missing from the current config.
|
OAuth2Auth |
rbacHandler(OAuth2RBAC rbac)
Deprecated.
|
OAuth2Auth |
refresh(User user,
Handler<AsyncResult<User>> handler)
Refresh the current User (access token).
|
OAuth2Auth |
revoke(User user,
String tokenType,
Handler<AsyncResult<Void>> handler)
Revoke an obtained access or refresh token.
|
OAuth2Auth |
userInfo(User user,
Handler<AsyncResult<JsonObject>> handler)
Retrieve profile information and other attributes for a logged-in end-user.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, decodeToken, endSessionURL, introspectToken, introspectToken, introspectToken, jWKSet, loadJWK, loadJWK, refresh, revoke, revoke, revoke, userInfoauthenticate, authenticatepublic OAuth2AuthProviderImpl(Vertx vertx, OAuth2Options config)
public OAuth2Auth jWKSet(Handler<AsyncResult<Void>> handler)
OAuth2AuthjWKSet in interface OAuth2Authhandler - the handler success/failure.public OAuth2Auth missingKeyHandler(Handler<String> handler)
OAuth2AuthOAuth2Auth.jWKSet(Handler) but being careful to implement
some rate limiting function.
This method isn't generic for several reasons. The provider is not aware of the capabilities
of the backend IdP in terms of max allowed API calls. Some validation could be done at the
key id, which only the end user is aware of.missingKeyHandler in interface OAuth2AuthOAuth2Auth.missingKeyHandler(Handler)public OAuth2Options getConfig()
public void authenticate(JsonObject authInfo, Handler<AsyncResult<User>> handler)
AuthenticationProviderThe first argument is a JSON object containing information for authenticating the user. What this actually contains depends on the specific implementation. In the case of a simple username/password based authentication it is likely to contain a JSON object with the following structure:
{
"username": "tim",
"password": "mypassword"
}
For other types of authentication it contain different information - for example a JWT token or OAuth bearer token.
If the user is successfully authenticated a User object is passed to the handler in an AsyncResult.
The user object can then be used for authorisation.
authenticate in interface AuthenticationProviderauthInfo - The credentialshandler - The result handlerpublic void authenticate(Credentials credentials, Handler<AsyncResult<User>> handler)
AuthenticationProvider
The first argument is a Credentials object containing information for authenticating the user.
What this actually contains depends on the specific implementation.
If the user is successfully authenticated a User object is passed to the handler in an AsyncResult.
The user object can then be used for authorisation.
authenticate in interface AuthenticationProvidercredentials - The credentialshandler - The result handlerpublic String authorizeURL(JsonObject params)
OAuth2AuthauthorizeURL in interface OAuth2Authparams - extra params to be included in the final URL.public OAuth2Auth refresh(User user, Handler<AsyncResult<User>> handler)
OAuth2Authrefresh in interface OAuth2Authuser - the user (access token) to be refreshed.handler - the handler success/failure.public OAuth2Auth revoke(User user, String tokenType, Handler<AsyncResult<Void>> handler)
OAuth2Authrevoke in interface OAuth2Authuser - the user (access token) to revoke.tokenType - the token type (either access_token or refresh_token).handler - the handler success/failure.public OAuth2Auth userInfo(User user, Handler<AsyncResult<JsonObject>> handler)
OAuth2AuthuserInfo in interface OAuth2Authuser - the user (access token) to fetch the user info.handler - the handler success/failure.public String endSessionURL(User user, JsonObject params)
OAuth2AuthendSessionURL in interface OAuth2Authuser - the user to generate the url forparams - extra parameters to apply to the url@Deprecated public OAuth2Auth decodeToken(String token, Handler<AsyncResult<AccessToken>> handler)
OAuth2AuthAccessToken object. This is useful to handle bearer JWT tokens.decodeToken in interface OAuth2Authtoken - the access token (base64 string)handler - A handler to receive the event@Deprecated public OAuth2Auth introspectToken(String token, String tokenType, Handler<AsyncResult<AccessToken>> handler)
OAuth2AuthintrospectToken in interface OAuth2Authtoken - the access token (base64 string)tokenType - hint to the token type e.g.: `access_token`handler - A handler to receive the event@Deprecated public OAuth2FlowType getFlowType()
OAuth2AuthgetFlowType in interface OAuth2Auth@Deprecated public OAuth2Auth rbacHandler(OAuth2RBAC rbac)
rbacHandler in interface OAuth2AuthCopyright © 2021. All rights reserved.