public class Pac4jHelper extends Object
Constructor and Description |
---|
Pac4jHelper(org.vertx.java.core.Vertx vertx) |
Pac4jHelper(org.vertx.java.core.Vertx vertx,
String address,
EventBusObjectConverter ebConverter) |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(org.vertx.java.core.http.HttpServerRequest req,
org.vertx.java.core.json.JsonObject sessionAttributes,
String clientName,
org.vertx.java.core.Handler<org.vertx.java.core.eventbus.Message<org.vertx.java.core.json.JsonObject>> handler)
Send an authenticate message to the pac4j manager.
|
org.vertx.java.core.json.JsonObject |
buildUserProfileResponse(Object profile,
org.vertx.java.core.json.JsonObject sessionAttributes) |
org.pac4j.core.profile.UserProfile |
decodeUserProfile(Object profile) |
String |
getFullRequestURL(org.vertx.java.core.http.HttpServerRequest request)
Get the full url from the given request.
|
void |
getRedirectUrls(org.vertx.java.core.http.HttpServerRequest req,
org.vertx.java.core.json.JsonObject sessionAttributes,
org.vertx.java.core.Handler<org.vertx.java.core.eventbus.Message<org.vertx.java.core.json.JsonObject>> handler,
String... clients)
Get the redirection urls for the given client names.
|
org.vertx.java.core.json.JsonObject |
getSessionAttributes(org.vertx.java.core.json.JsonObject response) |
Object |
getUserProfileFromResponse(org.vertx.java.core.json.JsonObject response) |
org.pac4j.core.profile.UserProfile |
getUserProfileFromSession(org.vertx.java.core.json.JsonObject session) |
boolean |
isErrorMessage(org.vertx.java.core.json.JsonObject response) |
boolean |
isRequiresHttpAction(org.vertx.java.core.json.JsonObject response) |
void |
redirect(org.vertx.java.core.http.HttpServerRequest req,
org.vertx.java.core.json.JsonObject sessionAttributes,
String clientName,
boolean protectedResource,
boolean isAjax,
org.vertx.java.core.Handler<org.vertx.java.core.eventbus.Message<org.vertx.java.core.json.JsonObject>> handler)
Send a redirect message to the pac4j manager.
|
void |
saveUserProfileInSession(Object profile,
org.vertx.java.core.json.JsonObject session) |
void |
sendErrorResponse(org.vertx.java.core.http.HttpServerResponse serverResponse,
org.vertx.java.core.json.JsonObject response)
Generate an error response.
|
void |
sendResponse(org.vertx.java.core.http.HttpServerResponse response,
org.vertx.java.core.json.JsonObject event)
Generate the Vertx response based on the pac4j manager response.
|
public Pac4jHelper(org.vertx.java.core.Vertx vertx)
public Pac4jHelper(org.vertx.java.core.Vertx vertx, String address, EventBusObjectConverter ebConverter)
public void redirect(org.vertx.java.core.http.HttpServerRequest req, org.vertx.java.core.json.JsonObject sessionAttributes, String clientName, boolean protectedResource, boolean isAjax, org.vertx.java.core.Handler<org.vertx.java.core.eventbus.Message<org.vertx.java.core.json.JsonObject>> handler)
req
- the HTTP requestsessionAttributes
- the session attributesclientName
- the client nameprotectedResource
- whether it is a protected resourceisAjax
- whether it is an AJAX callhandler
- the handlerpublic void getRedirectUrls(org.vertx.java.core.http.HttpServerRequest req, org.vertx.java.core.json.JsonObject sessionAttributes, org.vertx.java.core.Handler<org.vertx.java.core.eventbus.Message<org.vertx.java.core.json.JsonObject>> handler, String... clients)
req
- the HTTP requestsessionAttributes
- the session attributeshandler
- the handlerclients
- the pac4j clientspublic void authenticate(org.vertx.java.core.http.HttpServerRequest req, org.vertx.java.core.json.JsonObject sessionAttributes, String clientName, org.vertx.java.core.Handler<org.vertx.java.core.eventbus.Message<org.vertx.java.core.json.JsonObject>> handler)
req
- the HTTP requestsessionAttributes
- the session attributeshandler
- the handlerclientName
- the client namepublic void sendResponse(org.vertx.java.core.http.HttpServerResponse response, org.vertx.java.core.json.JsonObject event)
response
- the HTTP responseevent
- the eventpublic void sendErrorResponse(org.vertx.java.core.http.HttpServerResponse serverResponse, org.vertx.java.core.json.JsonObject response)
serverResponse
- the HTTP responseresponse
- the message responsepublic String getFullRequestURL(org.vertx.java.core.http.HttpServerRequest request)
request
- the HTTP requestpublic Object getUserProfileFromResponse(org.vertx.java.core.json.JsonObject response)
public org.pac4j.core.profile.UserProfile getUserProfileFromSession(org.vertx.java.core.json.JsonObject session)
public void saveUserProfileInSession(Object profile, org.vertx.java.core.json.JsonObject session)
public org.pac4j.core.profile.UserProfile decodeUserProfile(Object profile)
public org.vertx.java.core.json.JsonObject buildUserProfileResponse(Object profile, org.vertx.java.core.json.JsonObject sessionAttributes)
public org.vertx.java.core.json.JsonObject getSessionAttributes(org.vertx.java.core.json.JsonObject response)
public boolean isRequiresHttpAction(org.vertx.java.core.json.JsonObject response)
public boolean isErrorMessage(org.vertx.java.core.json.JsonObject response)
Copyright © 2015. All rights reserved.