UAAAuthorizationHandler

open class UAAAuthorizationHandler: AuthorizationHandler

AuthorizationHandler to extract authorization data from the UAA oAuth token

  • Initializes and returns a UAAAuthorizationHandler object

    Declaration

    Swift

    public init()
  • Starts the authorization process.

    Called by the associated AuthenticationManager when needed.

    Declaration

    Swift

    open func authorize(authenticationPayload: [String : Any], completionHandler: @escaping (_ userInformation: [String : Any]) -> Void)

    Parameters

    authenticationPayload

    the dictionary of information gathered during the authentication process. This information usually contains user-identifying tokens which are exchanged for specific user data during the authentication process.

    completionHandler

    closure called when authorization has completed.

    userInformation

    dictionary of user information retrieved during the authorization process.

  • Parses a UAA access token, and returns a dictionary of the token’s data components

    Declaration

    Swift

    open func parseAuthenticationData(from token: String) -> [String: Any]

    Parameters

    token

    A UAA access token

    Return Value

    dictionary of elements extracted from the provided token

  • Extracts the user name from the provided authentication data dictionary, and creates a User object.

    Declaration

    Swift

    open func createUser(authenticationData: [String: Any], userNameKey: String) -> User?

    Parameters

    authenticationData

    Dictionary of elements

    userNameKey

    Key in the dictionary of the user name

    Return Value

    User object created with the user’s name, or nil if no user name could be found