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]) throwsParameters
jsonJSON 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
IdPHandlerprotocol; ifIdPHandleris not provided, SDK will use default implementation ofIdPHandlerforgoogle,facebook, andapplebased onIdPClient‘sprovidervalue.Note:
signIn()method automatically setstokenandtokenTypevalues if provided using.setToken(), and.setTokenType()methods.Declaration
Swift
public func signIn(handler: IdPHandler? = nil, presentingViewController: UIViewController? = nil, completion: @escaping SocialLoginCompletionCallback)Parameters
handlerOptional
IdPHandlerinstance to perform social login; if not provided, SDK automatically selects the defaultIdPHandlerimplementation based onIdPClient.providervalue (google,facebook, andapple; case insensitive)presentingViewControllerCurrently presenting
UIViewControllerto present modal view for authorization using provider’s SDK. For certain providers,UIViewControllermust be presented.completionCompletion callback to notify the result
-
Sets
token_typevalue in callback responseDeclaration
Swift
public func setTokenType(_ tokenType: String)Parameters
tokenTypeString value of
token_type; can be either one ofid_token,access_token, orauthorization_code -
Sets
tokenvalue in callback responseDeclaration
Swift
public func setToken(_ token: String)Parameters
tokenString value of obtained credentials from the provider
View on GitHub