public class HttpAuthorizer extends 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(String endPoint)
Creates a new authorizer.
|
| Modifier and Type | Method and Description |
|---|---|
String |
authorize(String channelName,
String socketId)
Called when a channel is to be authenticated.
|
Boolean |
isSSL()
Identifies if the HTTP request will be sent over HTTPS.
|
void |
setHeaders(Map<String,String> headers)
Set additional headers to be sent as part of the request.
|
void |
setQueryStringParameters(HashMap<String,String> queryStringParameters)
This methods is for passing extra parameters authentication that needs to
be added to query string.
|
public HttpAuthorizer(String endPoint)
endPoint - The endpoint to be called when authenticating.public void setHeaders(Map<String,String> headers)
headers - A map of headerspublic Boolean isSSL()
public void setQueryStringParameters(HashMap<String,String> queryStringParameters)
queryStringParameters - the query parameterspublic String authorize(String channelName, 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.Copyright © 2016 Pusher. All rights reserved.