com.pusher.client.util.HttpAuthorizer.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pusher-java-client Show documentation
Show all versions of pusher-java-client Show documentation
This is a Java client library for Pusher, targeted at core Java and Android.
HttpAuthorizer (Pusher Java Websocket API)
com.pusher.client.util
Class HttpAuthorizer
- java.lang.Object
-
- com.pusher.client.util.HttpAuthorizer
-
- All Implemented Interfaces:
- Authorizer
public class HttpAuthorizer
extends java.lang.Object
implements Authorizer
Used to authenticate a 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 Summary
Constructors
Constructor and Description
HttpAuthorizer(java.lang.String endPoint)
Creates a new authorizer.
-
Method Summary
All Methods Instance Methods Concrete Methods
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.
-
-
Constructor Detail
-
HttpAuthorizer
public HttpAuthorizer(java.lang.String endPoint)
Creates a new authorizer.
- Parameters:
endPoint
- The endpoint to be called when authenticating.
-
Method Detail
-
setHeaders
public void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set additional headers to be sent as part of the request.
- Parameters:
headers
- A map of headers
-
isSSL
public java.lang.Boolean isSSL()
Identifies if the HTTP request will be sent over HTTPS.
- Returns:
- true if the endpoint protocol is 'https'
-
setQueryStringParameters
public 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.
- Parameters:
queryStringParameters
- the query parameters
-
authorize
public java.lang.String authorize(java.lang.String channelName,
java.lang.String socketId)
throws AuthorizationFailureException
Description copied from interface: Authorizer
Called when a channel is to be authenticated.
- Specified by:
authorize
in interface Authorizer
- Parameters:
channelName
- 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.
- Returns:
- An authentication token.
- Throws:
AuthorizationFailureException
- if the authentication fails.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy