Skip to content
Pascal Pfiffner edited this page Apr 12, 2016 · 2 revisions

OAuth2CodeGrant automatically puts the client-key/client-secret into an “Authorization: Basic” header. GitHub however needs those two in the POSTed body; you need to set the authConfig.secretInBody setting to true, either directly in code or via the secret_in_body key in the settings dictionary.

var oauth2: OAuth2CodeGrant = OAuth2CodeGrant(settings: [
    "client_id": "abcxyz",
    "client_secret": "9876zywvu",
    "authorize_uri": "https://github.com/login/oauth/authorize",
    "token_uri": "https://github.com/login/oauth/access_token",
    "scope": "user repo:status",
    "redirect_uris": ["oauthapp://oauth/callback"],   // register scheme in Info.plist
    "secret_in_body": true,
])
Clone this wiki locally