# First authentication login fails to redirect to redirectURI

**URL:** <https://discuss.dev.twitch.com/t/first-authentication-login-fails-to-redirect-to-redirecturi/25653>\
**Category:** API\
**Created:** [May 15, 2020, 7:27pm UTC](https://discuss.dev.twitch.com/t/first-authentication-login-fails-to-redirect-to-redirecturi/25653 "2020-05-15T19:27:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielWearsNada](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@DanielWearsNada](https://discuss.dev.twitch.com/u/DanielWearsNada)\
**Post date:** [May 15, 2020, 7:27pm UTC](https://discuss.dev.twitch.com/t/first-authentication-login-fails-to-redirect-to-redirecturi/25653/1 "2020-05-15T19:27:56Z")

</div>

I’m seeing the exact same issue as described in this closed post:

> [@Twitch login redirection not happening](https://discuss.dev.twitch.com/t/twitch-login-redirection-not-happening/24579):
>
> Hi, I’m building an app that uses twitch login and when i try to login with a twitch account using oauth and after logging-in the url redirection is not happning from the twitch. Somebody help me out here. This the URL that im using: “[https://id.twitch.tv/oauth2/authorize?client\_id=9rcsc3jp1tpgz1eobgc7ihbwcjvi1s&redirect\_uri=oauth-swift://oauth-callback/twitch&response\_type=code&scope=user\_read&state=pffc9mpKXp8bSrdfDTwO](https://id.twitch.tv/oauth2/authorize?client_id=9rcsc3jp1tpgz1eobgc7ihbwcjvi1s&redirect_uri=oauth-swift://oauth-callback/twitch&response_type=code&scope=user_read&state=pffc9mpKXp8bSrdfDTwO)”

It was closed due to inactivity. I’m using `ASWebAuthenticationSession` on iOS 13, and it seem that on initial login, the redirect URI is not called. Subsequent logins call it. Is this related to 2FA? Is there any workaround for this issue?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [May 15, 2020, 7:28pm UTC](https://discuss.dev.twitch.com/t/first-authentication-login-fails-to-redirect-to-redirecturi/25653/2 "2020-05-15T19:28:21Z")

</div>

> <https://github.com/twitchdev/issues/issues/106>
>
> \*\*Brief description\*\*
> 
> When using Oauth with 2FA, the redirect\_uri is not call…ed
> 
> \*\*How to reproduce\*\*
> 
> \- Open an app
> \- "Sign in with Twitch"
> \- Browser is opened on Twitch email / password signin
> \- I type username and password
> \- I get redirected to 2FA confirmation code
> \- I type the code
> \- The browser is redirected to Twitch homepage
> 
> \*\*Expected behavior\*\*
> 
> \- The browser is redirected to Twitch homepage \*while it should be redirecting to my redirect\_url\*

---

<div class="post-metadata">

**Author:** ![DanielWearsNada](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@DanielWearsNada](https://discuss.dev.twitch.com/u/DanielWearsNada)\
**Post date:** [May 15, 2020, 8:05pm UTC](https://discuss.dev.twitch.com/t/first-authentication-login-fails-to-redirect-to-redirecturi/25653/3 "2020-05-15T20:05:48Z")

</div>

Much appreciated!

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [June 14, 2020, 8:05pm UTC](https://discuss.dev.twitch.com/t/first-authentication-login-fails-to-redirect-to-redirecturi/25653/4 "2020-06-14T20:05:51Z")

</div>

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