IdPCallback
public class IdPCallback : MultipleValuesCallback
IdPCallback is a representation of Social Provider Handler Node
in AM when Client Type
option specified as NATIVE
(only available in AM 7.1 and above)
-
Selected identity provider client information
Declaration
Swift
public var idpClient: IdPClient
-
Designated initialization method for IdPCallback
Throws
AuthError.invalidCallbackResponse for invalid callback responseDeclaration
Swift
public required init(json: [String : Any]) throws
Parameters
json
JSON object of SelectIdPCallback
-
Builds input response for callback
Declaration
Swift
open override func buildResponse() -> [String : Any]
Return Value
JSON value for callback
-
Signs-in with selected Identity Provider using
IdPHandler
protocol; ifIdPHandler
is not provided, SDK will use default implementation ofIdPHandler
forgoogle
,facebook
, andapple
based onIdPClient
‘sprovider
value.Note:
signIn()
method automatically setstoken
andtokenType
values if provided using.setToken()
, and.setTokenType()
methods.Declaration
Swift
public func signIn(handler: IdPHandler? = nil, presentingViewController: UIViewController? = nil, completion: @escaping SocialLoginCompletionCallback)
Parameters
handler
Optional
IdPHandler
instance to perform social login; if not provided, SDK automatically selects the defaultIdPHandler
implementation based onIdPClient.provider
value (google
,facebook
, andapple
; case insensitive)presentingViewController
Currently presenting
UIViewController
to present modal view for authorization using provider’s SDK. For certain providers,UIViewController
must be presented.completion
Completion callback to notify the result
-
Sets
token_type
value in callback responseDeclaration
Swift
public func setTokenType(_ tokenType: String)
Parameters
tokenType
String value of
token_type
; can be either one ofid_token
,access_token
, orauthorization_code
-
Sets
token
value in callback responseDeclaration
Swift
public func setToken(_ token: String)
Parameters
token
String value of obtained credentials from the provider