public interface OAuth2Auth extends AuthProvider
AuthProvider
instances.Modifier and Type | Method and Description |
---|---|
OAuth2Auth |
api(io.vertx.core.http.HttpMethod method,
String path,
io.vertx.core.json.JsonObject params,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>> handler)
Call OAuth2 APIs.
|
String |
authorizeURL(io.vertx.core.json.JsonObject params)
Generate a redirect URL to the authN/Z backend.
|
static OAuth2Auth |
create(io.vertx.core.Vertx vertx,
OAuth2FlowType flow)
Create a OAuth2 auth provider
|
static OAuth2Auth |
create(io.vertx.core.Vertx vertx,
OAuth2FlowType flow,
OAuth2ClientOptions config)
Create a OAuth2 auth provider
|
static OAuth2Auth |
createKeycloak(io.vertx.core.Vertx vertx,
OAuth2FlowType flow,
io.vertx.core.json.JsonObject config)
Deprecated.
You should use the provider helper
KeycloakAuth instead.
Create a OAuth2 auth provider |
OAuth2Auth |
decodeToken(String token,
io.vertx.core.Handler<io.vertx.core.AsyncResult<AccessToken>> handler)
Decode a token to a
AccessToken object. |
OAuth2FlowType |
getFlowType()
Returns the configured flow type for the Oauth2 provider.
|
String |
getScopeSeparator()
Returns the scope separator.
|
void |
getToken(io.vertx.core.json.JsonObject params,
io.vertx.core.Handler<io.vertx.core.AsyncResult<AccessToken>> handler)
Returns the Access Token object.
|
boolean |
hasJWTToken()
Returns true if this provider supports JWT tokens as the access_token.
|
OAuth2Auth |
introspectToken(String token,
io.vertx.core.Handler<io.vertx.core.AsyncResult<AccessToken>> handler)
Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine
meta-information about this token.
|
OAuth2Auth |
introspectToken(String token,
String tokenType,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>> handler)
Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine
meta-information about this token.
|
authenticate
@Deprecated static OAuth2Auth createKeycloak(io.vertx.core.Vertx vertx, OAuth2FlowType flow, io.vertx.core.json.JsonObject config)
KeycloakAuth
instead.
Create a OAuth2 auth providervertx
- the Vertx instanceconfig
- the config as exported from the admin consolestatic OAuth2Auth create(io.vertx.core.Vertx vertx, OAuth2FlowType flow, OAuth2ClientOptions config)
vertx
- the Vertx instanceconfig
- the configstatic OAuth2Auth create(io.vertx.core.Vertx vertx, OAuth2FlowType flow)
vertx
- the Vertx instanceString authorizeURL(io.vertx.core.json.JsonObject params)
void getToken(io.vertx.core.json.JsonObject params, io.vertx.core.Handler<io.vertx.core.AsyncResult<AccessToken>> handler)
params
- - JSON with the options, each flow requires different options.handler
- - The handler returning the results.OAuth2Auth api(io.vertx.core.http.HttpMethod method, String path, io.vertx.core.json.JsonObject params, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>> handler)
method
- HttpMethodpath
- target pathparams
- parametershandler
- handlerboolean hasJWTToken()
OAuth2Auth decodeToken(String token, io.vertx.core.Handler<io.vertx.core.AsyncResult<AccessToken>> handler)
AccessToken
object. This is useful to handle bearer JWT tokens.token
- the access token (base64 string)handler
- A handler to receive the eventOAuth2Auth introspectToken(String token, io.vertx.core.Handler<io.vertx.core.AsyncResult<AccessToken>> handler)
token
- the access token (base64 string)handler
- A handler to receive the eventOAuth2Auth introspectToken(String token, String tokenType, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonObject>> handler)
token
- the access token (base64 string)tokenType
- hint to the token type e.g.: `access_token`handler
- A handler to receive the eventString getScopeSeparator()
OAuth2FlowType getFlowType()
Copyright © 2018. All rights reserved.