PushResponder

open class PushResponder

This singleton is an utility used to reply to Push Notifications received from OpenAM.

Constructors

Link copied to clipboard
private constructor(storageClient: StorageClient)
Private constructor restricted to this class itself

Properties

Link copied to clipboard
private val CHALLENGE_RESPONSE_KEY: String = "challengeResponse"
Link copied to clipboard
private val DENY_KEY: String = "deny"
Link copied to clipboard
private open var httpClient: OkHttpClient
OkHttp client to handle network requests
Link copied to clipboard
private open var INSTANCE: PushResponder
Link copied to clipboard
private val JWT_ALGORITHM: String = "HmacSHA256"
Link copied to clipboard
private val RESPONSE_KEY: String = "response"
Link copied to clipboard
private open var storageClient: StorageClient
StorageClient to persist operation result
Link copied to clipboard
private val TAG: String
Link copied to clipboard
private val TIMEOUT: Int = 30

Functions

Link copied to clipboard
open fun authentication(@NonNull pushNotification: PushNotification, approved: Boolean, @NonNull listener: FRAListener<Void>)
Used to respond an authentication request from a given message
Link copied to clipboard
open fun authenticationWithChallenge(@NonNull pushNotification: PushNotification, @NonNull challengeResponse: String, @NonNull listener: FRAListener<Void>)
Used to respond an authentication request from a given message
Link copied to clipboard
private open fun buildRequest(url: URL, amlbCookie: String, base64Secret: String, messageId: String, data: Map<String, Any>, action: String): Request
Build a request
Link copied to clipboard
open fun generateChallengeResponse(base64Secret: String, base64Challenge: String): String
Used to generate a challenge response using the shared secret
Link copied to clipboard
private open fun generateJwt(base64Secret: String, data: Map<String, Any>): String
Sign the payload with JWT
Link copied to clipboard
private open fun getAuthenticationPayload(pushNotification: PushNotification): Map<String, Any>
Link copied to clipboard
Return the PushResponder instance
open fun getInstance(@NonNull storageClient: StorageClient): PushResponder
Initialize/Return the PushResponder instance
Link copied to clipboard
private open fun getOkHttpClient(url: URL): OkHttpClient
The `OkHttpClient` instance used to make the HTTP calls
Link copied to clipboard
private open fun performAuthentication(@NonNull pushNotification: PushNotification, approved: Boolean, payload: Map<String, Any>, @NonNull listener: FRAListener<Void>)
Used to respond an authentication request from a given message
Link copied to clipboard
open fun registration(endpoint: String, amlbCookie: String, base64Secret: String, messageId: String, payload: Map<String, Any>, listener: FRAListener<Void>)
Used to respond to a Push registration for a given endpoint
Link copied to clipboard
open fun reset()