OAuth2ClientCredentialsReddit

public class OAuth2ClientCredentialsReddit : OAuth2ClientCredentials

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

  • Declaration

    Swift

    override public class var grantType: String { get }
  • An identifier of the device requesting the token. You should generate and save a unique ID on your client. DO NOT use any personally identifiable information (including non-user-resettable information, such as Android’s TelephonyManager.getDeviceId() or iOS’s IDFA).

    Declaration

    Swift

    public var deviceId: String?
  • The special Reddit client credentials flow for installed apps adds the device_id key to the settings dictionary.

    Declaration

    Swift

    override public init(settings: OAuth2JSON)

    Parameters

    settings

    The authorization settings

  • Add device_id parameter to the request created by the superclass.

    Declaration

    Swift

    override open func accessTokenRequest(params: OAuth2StringDict? = nil) throws -> OAuth2AuthRequest