OAuth2ContextStore

open class OAuth2ContextStore

Class, internally used, to store current authorization context, such as state and redirect-url.

  • Currently used redirect_url.

    Declaration

    Swift

    open var redirectURL: String?
  • Current code verifier used for PKCE

    Declaration

    Swift

    public internal(set) var codeVerifier: String? { get }
  • Undocumented

    Declaration

    Swift

    public let codeChallengeMethod: String
  • The current state.

    Declaration

    Swift

    internal var _state: String
  • The state sent to the server when requesting a token.

    We internally generate a UUID and use the first 8 chars if _state is empty.

    Declaration

    Swift

    open var state: String { get }
  • Checks that given state matches the internal state.

    Declaration

    Swift

    func matchesState(_ state: String?) -> Bool

    Parameters

    state

    The state to check (may be nil)

    Return Value

    true if state matches, false otherwise or if given state is nil.

  • Resets current state so it gets regenerated next time it’s needed.

    Declaration

    Swift

    func resetState()

PKCE

  • Generates a new code verifier string

    Declaration

    Swift

    open func generateCodeVerifier()
  • Undocumented

    Declaration

    Swift

    open func codeChallenge() -> String?