oAuth using Swift SFAuthenticationSession

Hi,

I am using Swift SFAuthenticationSession for https://api.twitch.tv/helix/oauth2/authorize
Getting {“error”:“Not Found”,“status”:404,“message”:""}

What is missing from below request?

https://api.twitch.tv/helix/oauth2/authorize?client_id=myclientid&redirect_uri=https://api.twitch.tv/helix&scope=user_read&response_type=token

Apple SFAuthentication takes only URL, no Header

SFAuthenticationSession(url URL: URL,
callbackURLScheme: String?,
completionHandler: @escaping SFAuthenticationSession.CompletionHandler)

Should be https://api.twitch.tv/kraken/oauth2/authorize not https://api.twitch.tv/helix/oauth2/authorize.

Working, Thanks!
I thought supposed to switch to new API

Auth is still on the kraken end point

Changed to kraken, after entering user id & pwd started getting Bad request as attached screen,
Once it is failed, keep getting this to any further calls:
Getting {“error”:“Not Found”,“status”:404,“message”:""}

URL:
https://api.twitch.tv/kraken/oauth2/authorize?client_id=myclientid&redirect_uri=https://api.twitch.tv/helix&scope=user_read&response_type=token

Why are you using https://api.twitch.tv/helix as a redirect url?

my application do not have any url, I am just doing a practice iOS App to test in multiple devices, what should I use?

I don’t use the implicit code flow myself, but if I understand it right you just use http://localhost (and set the redirect to match that in your dev dashboard) and have your app grab the access token as a fragment of the URL.

Tried that, it failed

You need to be using Implicit auth for an iOS app:

Yes, I am using the same, but I cannot pass header values, there is no option Apple SFAuthenticationSession

Apple SFAuthentication takes only URL, no Header

SFAuthenticationSession(url URL: URL,
callbackURLScheme: String?,
completionHandler: @escaping SFAuthenticationSession.CompletionHandler)

Using implicit auth the redirect URL should be the URL the auth is initiated from, as the user will end up in [redirect url]#access_token=something&state=and-so-on....

What should be the URL, the auth is initiated from a native iOS App?

As per other Apps like instagram, it is URL schemes supposed to define in plist.
But on twitch dev account, it only allows url like http://something.com

As per other Apps, OAuth request, TwitchOAuth is defined as attached

redirect_uri=TwitchOAuth://

:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.