Flows

  • A class to handle authorization for confidential clients via the authorization code grant method.

    This auth flow is designed for clients that are capable of protecting their client secret but can be used from installed apps. During code exchange and token refresh flows, if the client has a secret, a “Basic key:secret” Authorization header will be used. If not the client key will be embedded into the request body.

    See more

    Declaration

    Swift

    open class OAuth2CodeGrant : OAuth2
  • Enhancing the code grant flow by allowing to specify a specific “Basic xx” authorization header.

    This class allows you to manually set the “Authorization” header to a given string, as accepted in its basicToken property. It will override the superclasses automatic generation of an Authorization header if the client has a clientSecret, so you only need to use this subclass if you need a different header (this is different to version 1.2.3 and earlier of this framework).

    See more

    Declaration

    Swift

    open class OAuth2CodeGrantBasicAuth : OAuth2CodeGrant
  • Azure requires a resource, hence our init requires it as well

    See more

    Declaration

    Swift

    public class OAuth2CodeGrantAzure : OAuth2CodeGrant
  • Facebook only returns an “access_token=xyz&…” string, no true JSON, hence we override parseTokenExchangeResponse and deal with the situation in a subclass.

    See more

    Declaration

    Swift

    public class OAuth2CodeGrantFacebook : OAuth2CodeGrant
  • LinkedIn-specific subclass to deal with LinkedIn peculiarities:

    • Must have client-id/secret in request body
    • Must use custom web view in order to be able to intercept http(s) redirects
    • Will not return the “token_type” value, so must ignore it not being present
    See more

    Declaration

    Swift

    public class OAuth2CodeGrantLinkedIn : OAuth2CodeGrant
  • Subclass to deal with sites that don’t return token_type, such as Instagram or Bitly.

    See more

    Declaration

    Swift

    public class OAuth2CodeGrantNoTokenType : OAuth2CodeGrant
  • Class to handle two-legged OAuth2 requests of the “client_credentials” type.

    See more

    Declaration

    Swift

    open class OAuth2ClientCredentials : OAuth2
  • Enables Reddit’s special client credentials flow for installed apps.

    This flow will specify https://oauth.reddit.com/grants/installed_client as grant type and also supply a device_id, which you must set during configuration or by setting the deviceId property.

    https://github.com/reddit/reddit/wiki/OAuth2#application-only-oauth

    See more

    Declaration

    Swift

    public class OAuth2ClientCredentialsReddit : OAuth2ClientCredentials
  • Class to handle OAuth2 requests for public clients, such as distributed Mac/iOS Apps.

    See more

    Declaration

    Swift

    open class OAuth2ImplicitGrant : OAuth2
  • A class to handle authorization for clients via password grant.

    If no credentials are set when authorizing, a native controller is shown so that the user can provide them.

    See more

    Declaration

    Swift

    open class OAuth2PasswordGrant : OAuth2
  • An object adopting this protocol is responsible of the creation of the login controller

    See more

    Declaration

    Swift

    public protocol OAuth2PasswordGrantDelegate : AnyObject