public class HttpAuthorizer extends java.lang.Object implements Authorizer
private or presence
channel subscription.
Makes an HTTP request to a defined HTTP endpoint. Expects an authentication token to be returned.
For more information see the Authenticating Users documentation.
| Constructor and Description |
|---|
HttpAuthorizer(java.lang.String endPoint)
Creates a new authorizer.
|
HttpAuthorizer(java.lang.String endPoint,
ConnectionFactory connectionFactory)
Creates a new authorizer.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
authorize(java.lang.String channelName,
java.lang.String socketId)
Called when a channel is to be authenticated.
|
java.lang.Boolean |
isSSL()
Identifies if the HTTP request will be sent over HTTPS.
|
void |
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set additional headers to be sent as part of the request.
|
public HttpAuthorizer(java.lang.String endPoint)
endPoint - The endpoint to be called when authenticating.public HttpAuthorizer(java.lang.String endPoint, ConnectionFactory connectionFactory)
endPoint - The endpoint to be called when authenticating.connectionFactory - a custom connection factory to be used for building the connectionpublic void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers - A map of headerspublic java.lang.Boolean isSSL()
public java.lang.String authorize(java.lang.String channelName, java.lang.String socketId) throws AuthorizationFailureException
Authorizerauthorize in interface AuthorizerchannelName - The name of the channel to be authenticated.socketId - A unique socket connection ID to be used with the
authentication. This uniquely identifies the connection that
the subscription is being authenticated for.AuthorizationFailureException - if the authentication fails.