Class OAuth2Auth
- java.lang.Object
-
- io.vertx.mutiny.ext.auth.authentication.AuthenticationProvider
-
- io.vertx.mutiny.ext.auth.oauth2.OAuth2Auth
-
public class OAuth2Auth extends AuthenticationProvider
Factory interface for creating OAuth2 basedAuthenticationProvider
instances. NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<OAuth2Auth>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description OAuth2Auth(io.vertx.ext.auth.oauth2.OAuth2Auth delegate)
OAuth2Auth(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
authorizeURL(io.vertx.core.json.JsonObject params)
static OAuth2Auth
create(Vertx vertx)
static OAuth2Auth
create(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
io.smallrye.mutiny.Uni<AccessToken>
decodeToken(String token)
Deprecated.AccessToken
decodeTokenAndAwait(String token)
Deprecated.OAuth2Auth
decodeTokenAndForget(String token)
Deprecated.String
endSessionURL(User user)
String
endSessionURL(User user, io.vertx.core.json.JsonObject params)
boolean
equals(Object o)
io.vertx.ext.auth.oauth2.OAuth2Auth
getDelegate()
io.vertx.ext.auth.oauth2.OAuth2FlowType
getFlowType()
Deprecated.int
hashCode()
io.smallrye.mutiny.Uni<AccessToken>
introspectToken(String token)
Deprecated.io.smallrye.mutiny.Uni<AccessToken>
introspectToken(String token, String tokenType)
Deprecated.AccessToken
introspectTokenAndAwait(String token)
Deprecated.AccessToken
introspectTokenAndAwait(String token, String tokenType)
Deprecated.OAuth2Auth
introspectTokenAndForget(String token)
Deprecated.OAuth2Auth
introspectTokenAndForget(String token, String tokenType)
Deprecated.io.smallrye.mutiny.Uni<Void>
jWKSet()
Retrieve the public server JSON Web Key (JWK) required to verify the authenticity of issued ID and access tokens.Void
jWKSetAndAwait()
Blocking variant ofjWKSet()
.OAuth2Auth
jWKSetAndForget()
Variant ofjWKSet()
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
loadJWK()
Deprecated.Use#jWKSet(Handler)
Void
loadJWKAndAwait()
Deprecated.Use#jWKSet(Handler)
OAuth2Auth
loadJWKAndForget()
Deprecated.Use#jWKSet(Handler)
OAuth2Auth
missingKeyHandler(Consumer<String> handler)
static OAuth2Auth
newInstance(io.vertx.ext.auth.oauth2.OAuth2Auth arg)
OAuth2Auth
rbacHandler(OAuth2RBAC rbac)
Deprecated.io.smallrye.mutiny.Uni<User>
refresh(User user)
Refresh the current User (access token).User
refreshAndAwait(User user)
Blocking variant ofrefresh(io.vertx.mutiny.ext.auth.User)
.OAuth2Auth
refreshAndForget(User user)
Variant ofrefresh(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
revoke(User user)
Revoke an obtained access token.io.smallrye.mutiny.Uni<Void>
revoke(User user, String tokenType)
Revoke an obtained access or refresh token.Void
revokeAndAwait(User user)
Blocking variant ofrevoke(io.vertx.mutiny.ext.auth.User)
.Void
revokeAndAwait(User user, String tokenType)
Blocking variant ofrevoke(io.vertx.mutiny.ext.auth.User,String)
.OAuth2Auth
revokeAndForget(User user)
Variant ofrevoke(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.OAuth2Auth
revokeAndForget(User user, String tokenType)
Variant ofrevoke(io.vertx.mutiny.ext.auth.User,String)
that ignores the result of the operation.String
toString()
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
userInfo(User user)
Retrieve profile information and other attributes for a logged-in end-user.io.vertx.core.json.JsonObject
userInfoAndAwait(User user)
Blocking variant ofuserInfo(io.vertx.mutiny.ext.auth.User)
.OAuth2Auth
userInfoAndForget(User user)
Variant ofuserInfo(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.-
Methods inherited from class io.vertx.mutiny.ext.auth.authentication.AuthenticationProvider
authenticate, authenticate, authenticateAndAwait, authenticateAndAwait, authenticateAndForget, authenticateAndForget, newInstance
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<OAuth2Auth> __TYPE_ARG
-
-
Constructor Detail
-
OAuth2Auth
public OAuth2Auth(io.vertx.ext.auth.oauth2.OAuth2Auth delegate)
-
OAuth2Auth
public OAuth2Auth(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.auth.oauth2.OAuth2Auth getDelegate()
- Overrides:
getDelegate
in classAuthenticationProvider
-
toString
public String toString()
- Overrides:
toString
in classAuthenticationProvider
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAuthenticationProvider
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAuthenticationProvider
-
create
public static OAuth2Auth create(Vertx vertx)
- Parameters:
vertx
- the Vertx instance- Returns:
- the auth provider
-
create
public static OAuth2Auth create(Vertx vertx, io.vertx.ext.auth.oauth2.OAuth2Options config)
- Parameters:
vertx
- the Vertx instanceconfig
- the config- Returns:
- the auth provider
-
jWKSet
public io.smallrye.mutiny.Uni<Void> jWKSet()
Retrieve the public server JSON Web Key (JWK) required to verify the authenticity of issued ID and access tokens. The provider will refresh the keys according to: https://openid.net/specs/openid-connect-core-1_0.html#RotateEncKeys This means that the provider will look at the cache headers and will refresh when the max-age is reached. If the server does not return any cache headers it shall be up to the end user to call this method to refresh. To avoid the refresh to happen too late, this means that they keys will be invalid, if theOAuth2Options
JWTOptions
config contains a positive leeway, it will be used to request the refresh ahead of time.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
jWKSetAndAwait
public Void jWKSetAndAwait()
Blocking variant ofjWKSet()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
jWKSetAndForget
public OAuth2Auth jWKSetAndForget()
Variant ofjWKSet()
that ignores the result of the operation.This method subscribes on the result of
jWKSet()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromjWKSet()
but you don't need to compose it with other operations.- Returns:
- the instance of OAuth2Auth to chain method calls.
-
missingKeyHandler
public OAuth2Auth missingKeyHandler(Consumer<String> handler)
- Parameters:
handler
-- Returns:
-
authorizeURL
public String authorizeURL(io.vertx.core.json.JsonObject params)
- Parameters:
params
- extra params to be included in the final URL.- Returns:
- the url to be used to authorize the user.
-
refresh
public io.smallrye.mutiny.Uni<User> refresh(User user)
Refresh the current User (access token).Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
user
- the user (access token) to be refreshed.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
refreshAndAwait
public User refreshAndAwait(User user)
Blocking variant ofrefresh(io.vertx.mutiny.ext.auth.User)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
user
- the user (access token) to be refreshed.- Returns:
- the User instance produced by the operation.
-
refreshAndForget
public OAuth2Auth refreshAndForget(User user)
Variant ofrefresh(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.This method subscribes on the result of
refresh(io.vertx.mutiny.ext.auth.User)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrefresh(io.vertx.mutiny.ext.auth.User)
but you don't need to compose it with other operations.- Parameters:
user
- the user (access token) to be refreshed.- Returns:
- the instance of OAuth2Auth to chain method calls.
-
revoke
public io.smallrye.mutiny.Uni<Void> revoke(User user, String tokenType)
Revoke an obtained access or refresh token. More info https://tools.ietf.org/html/rfc7009.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
user
- the user (access token) to revoke.tokenType
- the token type (either access_token or refresh_token).- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
revokeAndAwait
public Void revokeAndAwait(User user, String tokenType)
Blocking variant ofrevoke(io.vertx.mutiny.ext.auth.User,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
user
- the user (access token) to revoke.tokenType
- the token type (either access_token or refresh_token).- Returns:
- the Void instance produced by the operation.
-
revokeAndForget
public OAuth2Auth revokeAndForget(User user, String tokenType)
Variant ofrevoke(io.vertx.mutiny.ext.auth.User,String)
that ignores the result of the operation.This method subscribes on the result of
revoke(io.vertx.mutiny.ext.auth.User,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrevoke(io.vertx.mutiny.ext.auth.User,String)
but you don't need to compose it with other operations.- Parameters:
user
- the user (access token) to revoke.tokenType
- the token type (either access_token or refresh_token).- Returns:
- the instance of OAuth2Auth to chain method calls.
-
revoke
public io.smallrye.mutiny.Uni<Void> revoke(User user)
Revoke an obtained access token. More info https://tools.ietf.org/html/rfc7009.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
user
- the user (access token) to revoke.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
revokeAndAwait
public Void revokeAndAwait(User user)
Blocking variant ofrevoke(io.vertx.mutiny.ext.auth.User)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
user
- the user (access token) to revoke.- Returns:
- the Void instance produced by the operation.
-
revokeAndForget
public OAuth2Auth revokeAndForget(User user)
Variant ofrevoke(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.This method subscribes on the result of
revoke(io.vertx.mutiny.ext.auth.User)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrevoke(io.vertx.mutiny.ext.auth.User)
but you don't need to compose it with other operations.- Parameters:
user
- the user (access token) to revoke.- Returns:
- the instance of OAuth2Auth to chain method calls.
-
userInfo
public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> userInfo(User user)
Retrieve profile information and other attributes for a logged-in end-user. More info https://openid.net/specs/openid-connect-core-1_0.html#UserInfoUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
user
- the user (access token) to fetch the user info.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
userInfoAndAwait
public io.vertx.core.json.JsonObject userInfoAndAwait(User user)
Blocking variant ofuserInfo(io.vertx.mutiny.ext.auth.User)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
user
- the user (access token) to fetch the user info.- Returns:
- the JsonObject instance produced by the operation.
-
userInfoAndForget
public OAuth2Auth userInfoAndForget(User user)
Variant ofuserInfo(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.This method subscribes on the result of
userInfo(io.vertx.mutiny.ext.auth.User)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromuserInfo(io.vertx.mutiny.ext.auth.User)
but you don't need to compose it with other operations.- Parameters:
user
- the user (access token) to fetch the user info.- Returns:
- the instance of OAuth2Auth to chain method calls.
-
endSessionURL
public String endSessionURL(User user, io.vertx.core.json.JsonObject params)
- Parameters:
user
- the user to generate the url forparams
- extra parameters to apply to the url- Returns:
- the url to end the session.
-
endSessionURL
public String endSessionURL(User user)
- Parameters:
user
- the user to generate the url for- Returns:
- the url to end the session.
-
decodeToken
@Deprecated public io.smallrye.mutiny.Uni<AccessToken> decodeToken(String token)
Deprecated.Decode a token to aAccessToken
object. This is useful to handle bearer JWT tokens.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
token
- the access token (base64 string)- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
decodeTokenAndAwait
@Deprecated public AccessToken decodeTokenAndAwait(String token)
Deprecated.Blocking variant ofdecodeToken(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
token
- the access token (base64 string)- Returns:
- the AccessToken instance produced by the operation.
-
decodeTokenAndForget
@Deprecated public OAuth2Auth decodeTokenAndForget(String token)
Deprecated.Variant ofdecodeToken(String)
that ignores the result of the operation.This method subscribes on the result of
decodeToken(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdecodeToken(String)
but you don't need to compose it with other operations.- Parameters:
token
- the access token (base64 string)- Returns:
- the instance of OAuth2Auth to chain method calls.
-
introspectToken
@Deprecated public io.smallrye.mutiny.Uni<AccessToken> introspectToken(String token)
Deprecated.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.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
token
- the access token (base64 string)- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
introspectTokenAndAwait
@Deprecated public AccessToken introspectTokenAndAwait(String token)
Deprecated.Blocking variant ofintrospectToken(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
token
- the access token (base64 string)- Returns:
- the AccessToken instance produced by the operation.
-
introspectTokenAndForget
@Deprecated public OAuth2Auth introspectTokenAndForget(String token)
Deprecated.Variant ofintrospectToken(String)
that ignores the result of the operation.This method subscribes on the result of
introspectToken(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromintrospectToken(String)
but you don't need to compose it with other operations.- Parameters:
token
- the access token (base64 string)- Returns:
- the instance of OAuth2Auth to chain method calls.
-
introspectToken
@Deprecated public io.smallrye.mutiny.Uni<AccessToken> introspectToken(String token, String tokenType)
Deprecated.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.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
token
- the access token (base64 string)tokenType
- hint to the token type e.g.: `access_token`- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
introspectTokenAndAwait
@Deprecated public AccessToken introspectTokenAndAwait(String token, String tokenType)
Deprecated.Blocking variant ofintrospectToken(String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
token
- the access token (base64 string)tokenType
- hint to the token type e.g.: `access_token`- Returns:
- the AccessToken instance produced by the operation.
-
introspectTokenAndForget
@Deprecated public OAuth2Auth introspectTokenAndForget(String token, String tokenType)
Deprecated.Variant ofintrospectToken(String,String)
that ignores the result of the operation.This method subscribes on the result of
introspectToken(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromintrospectToken(String,String)
but you don't need to compose it with other operations.- Parameters:
token
- the access token (base64 string)tokenType
- hint to the token type e.g.: `access_token`- Returns:
- the instance of OAuth2Auth to chain method calls.
-
getFlowType
@Deprecated public io.vertx.ext.auth.oauth2.OAuth2FlowType getFlowType()
Deprecated.- Returns:
- the flow type.
-
loadJWK
@Deprecated public io.smallrye.mutiny.Uni<Void> loadJWK()
Deprecated.Use#jWKSet(Handler)
Loads a JWK Set from the remote provider. When calling this method several times, the loaded JWKs are updated in the underlying JWT object.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
loadJWKAndAwait
@Deprecated public Void loadJWKAndAwait()
Deprecated.Use#jWKSet(Handler)
Blocking variant ofloadJWK()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
loadJWKAndForget
@Deprecated public OAuth2Auth loadJWKAndForget()
Deprecated.Use#jWKSet(Handler)
Variant ofloadJWK()
that ignores the result of the operation.This method subscribes on the result of
loadJWK()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromloadJWK()
but you don't need to compose it with other operations.- Returns:
- the instance of OAuth2Auth to chain method calls.
-
rbacHandler
@Deprecated public OAuth2Auth rbacHandler(OAuth2RBAC rbac)
Deprecated.
-
newInstance
public static OAuth2Auth newInstance(io.vertx.ext.auth.oauth2.OAuth2Auth arg)
-
-