public class OAuth2AuthHandler extends Object implements AuthHandler, Handler<RoutingContext>
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<OAuth2AuthHandler> |
__TYPE_ARG |
Constructor and Description |
---|
OAuth2AuthHandler(OAuth2AuthHandler delegate) |
OAuth2AuthHandler(Object delegate) |
Modifier and Type | Method and Description |
---|---|
AuthHandler |
addAuthorities(Set<String> authorities)
Add a set of required authorities for this auth handler
|
AuthHandler |
addAuthority(String authority)
Add a required authority for this auth handler
|
void |
authorize(User user,
Handler<AsyncResult<Void>> handler)
Authorizes the given user against all added authorities.
|
Observable<Void> |
authorizeObservable(User user)
Deprecated.
use
rxAuthorize(io.vertx.rxjava.ext.auth.User) instead |
static OAuth2AuthHandler |
create(OAuth2Auth authProvider)
Create a OAuth2 auth handler without host pinning.
|
static OAuth2AuthHandler |
create(OAuth2Auth authProvider,
String callbackURL)
Create a OAuth2 auth handler with host pinning
|
boolean |
equals(Object o) |
OAuth2AuthHandler |
extraParams(JsonObject extraParams)
Extra parameters needed to be passed while requesting a token.
|
OAuth2AuthHandler |
getDelegate() |
void |
handle(RoutingContext event)
Something has happened, so handle it.
|
int |
hashCode() |
static OAuth2AuthHandler |
newInstance(OAuth2AuthHandler arg) |
void |
parseCredentials(RoutingContext context,
Handler<AsyncResult<JsonObject>> handler)
Parses the credentials from the request into a JsonObject.
|
Observable<JsonObject> |
parseCredentialsObservable(RoutingContext context)
Deprecated.
|
Single<Void> |
rxAuthorize(User user)
Authorizes the given user against all added authorities.
|
Single<JsonObject> |
rxParseCredentials(RoutingContext context)
Parses the credentials from the request into a JsonObject.
|
OAuth2AuthHandler |
setupCallback(Route route)
add the callback handler to a given route.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance
public static final io.vertx.lang.rx.TypeArg<OAuth2AuthHandler> __TYPE_ARG
public OAuth2AuthHandler(OAuth2AuthHandler delegate)
public OAuth2AuthHandler(Object delegate)
public OAuth2AuthHandler getDelegate()
getDelegate
in interface AuthHandler
public void handle(RoutingContext event)
handle
in interface Handler<RoutingContext>
handle
in interface AuthHandler
event
- the event to handlepublic AuthHandler addAuthority(String authority)
addAuthority
in interface AuthHandler
authority
- the authoritypublic AuthHandler addAuthorities(Set<String> authorities)
addAuthorities
in interface AuthHandler
authorities
- the set of authoritiespublic void parseCredentials(RoutingContext context, Handler<AsyncResult<JsonObject>> handler)
parseCredentials
in interface AuthHandler
context
- the routing contexthandler
- the handler to be called once the information is available.@Deprecated public Observable<JsonObject> parseCredentialsObservable(RoutingContext context)
rxParseCredentials(io.vertx.rxjava.ext.web.RoutingContext)
insteadcontext
- the routing contextpublic Single<JsonObject> rxParseCredentials(RoutingContext context)
context
- the routing contextpublic void authorize(User user, Handler<AsyncResult<Void>> handler)
authorize
in interface AuthHandler
user
- a user.handler
- the handler for the result.@Deprecated public Observable<Void> authorizeObservable(User user)
rxAuthorize(io.vertx.rxjava.ext.auth.User)
insteaduser
- a user.public Single<Void> rxAuthorize(User user)
user
- a user.public static OAuth2AuthHandler create(OAuth2Auth authProvider, String callbackURL)
authProvider
- the auth provider to usecallbackURL
- the callback URL you entered in your provider admin console, usually it should be something like: `https://myserver:8888/callback`public static OAuth2AuthHandler create(OAuth2Auth authProvider)
authProvider
- the auth provider to usepublic OAuth2AuthHandler extraParams(JsonObject extraParams)
extraParams
- extra optional parameters.public OAuth2AuthHandler setupCallback(Route route)
route
- a given route e.g.: `/callback`public static OAuth2AuthHandler newInstance(OAuth2AuthHandler arg)
Copyright © 2023 Eclipse. All rights reserved.