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 moreDeclaration
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
See morebasicToken
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).Declaration
Swift
open class OAuth2CodeGrantBasicAuth : OAuth2CodeGrant
-
Azure requires a
See moreresource
, hence ourinit
requires it as wellDeclaration
Swift
public class OAuth2CodeGrantAzure : OAuth2CodeGrant
-
Facebook only returns an “access_token=xyz&…” string, no true JSON, hence we override
See moreparseTokenExchangeResponse
and deal with the situation in a subclass.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
Declaration
Swift
public class OAuth2CodeGrantLinkedIn : OAuth2CodeGrant
-
Subclass to deal with sites that don’t return
See moretoken_type
, such as Instagram or Bitly.Declaration
Swift
public class OAuth2CodeGrantNoTokenType : OAuth2CodeGrant
-
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 adevice_id
, which you must set during configuration or by setting thedeviceId
property.https://github.com/reddit/reddit/wiki/OAuth2#application-only-oauth
See moreDeclaration
Swift
public class OAuth2ClientCredentialsReddit : OAuth2ClientCredentials
-
An object adopting this protocol is responsible of the creation of the login controller
See moreDeclaration
Swift
public protocol OAuth2PasswordGrantDelegate : AnyObject