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.
|
| 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.
|
void |
setQueryStringParameters(java.util.HashMap<java.lang.String,java.lang.String> queryStringParameters)
This methods is for passing extra parameters authentication that needs to
be added to query string.
|
public HttpAuthorizer(java.lang.String endPoint)
endPoint - The endpoint to be called when authenticating.public void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers - A map of headerspublic java.lang.Boolean isSSL()
public void setQueryStringParameters(java.util.HashMap<java.lang.String,java.lang.String> queryStringParameters)
queryStringParameters - the query parameterspublic 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.