Class OAuth2Auth
- All Implemented Interfaces:
MutinyDelegate
AuthenticationProvider
instances.
NOTE: This class has been automatically generated from the original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOAuth2Auth
(io.vertx.ext.auth.oauth2.OAuth2Auth delegate) OAuth2Auth
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionauthorizeURL
(io.vertx.core.json.JsonObject params) Deprecated.authorizeURL
(io.vertx.ext.auth.oauth2.OAuth2AuthorizationURL url) void
close()
static OAuth2Auth
static OAuth2Auth
endSessionURL
(User user) endSessionURL
(User user, io.vertx.core.json.JsonObject params) boolean
io.vertx.ext.auth.oauth2.OAuth2Auth
int
hashCode()
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.Blocking variant ofjWKSet()
.Variant ofjWKSet()
that ignores the result of the operation.missingKeyHandler
(Consumer<String> handler) static OAuth2Auth
newInstance
(io.vertx.ext.auth.oauth2.OAuth2Auth arg) io.smallrye.mutiny.Uni<User>
Refresh the current User (access token).refreshAndAwait
(User user) Blocking variant ofrefresh(io.vertx.mutiny.ext.auth.User)
.refreshAndForget
(User user) Variant ofrefresh(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
Revoke an obtained access token.io.smallrye.mutiny.Uni<Void>
Revoke an obtained access or refresh token.revokeAndAwait
(User user) Blocking variant ofrevoke(io.vertx.mutiny.ext.auth.User)
.revokeAndAwait
(User user, String tokenType) Blocking variant ofrevoke(io.vertx.mutiny.ext.auth.User,String)
.revokeAndForget
(User user) Variant ofrevoke(io.vertx.mutiny.ext.auth.User)
that ignores the result of the operation.revokeAndForget
(User user, String tokenType) Variant ofrevoke(io.vertx.mutiny.ext.auth.User,String)
that ignores the result of the operation.toString()
io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject>
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)
.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 Details
-
__TYPE_ARG
-
-
Constructor Details
-
OAuth2Auth
public OAuth2Auth(io.vertx.ext.auth.oauth2.OAuth2Auth delegate) -
OAuth2Auth
-
-
Method Details
-
getDelegate
public io.vertx.ext.auth.oauth2.OAuth2Auth getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Overrides:
getDelegate
in classAuthenticationProvider
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
- Overrides:
toString
in classAuthenticationProvider
-
equals
- Overrides:
equals
in classAuthenticationProvider
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAuthenticationProvider
-
create
- Parameters:
vertx
- the Vertx instance- Returns:
- the auth provider
-
create
- Parameters:
vertx
- the Vertx instanceconfig
- the config- Returns:
- the auth provider
-
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. Key rotation can be controled byOAuth2Options
.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
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
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
- Parameters:
handler
-- Returns:
-
authorizeURL
Deprecated.For type safety this method should be avoided andauthorizeURL(OAuth2AuthorizationURL)
should be used instead.- Parameters:
params
- extra params to be included in the final URL.- Returns:
- the url to be used to authorize the user.
-
authorizeURL
- Parameters:
url
- Base URL with path together with other parameters to be included in the final URL.- Returns:
- the url to be used to authorize the user.
-
refresh
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
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
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
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
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
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
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
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
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
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
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
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
- Parameters:
user
- the user to generate the url forparams
- extra parameters to apply to the url- Returns:
- the url to end the session.
-
endSessionURL
- Parameters:
user
- the user to generate the url for- Returns:
- the url to end the session.
-
close
public void close() -
newInstance
-
authorizeURL(OAuth2AuthorizationURL)
should be used instead.