# Authenticate users to dynamic URL

**URL:** <https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583>\
**Category:** API\
**Created:** [February 7, 2015, 6:01pm UTC](https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583 "2015-02-07T18:01:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GodsVictory](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@GodsVictory](https://discuss.dev.twitch.com/u/GodsVictory)\
**Post date:** [February 7, 2015, 6:01pm UTC](https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583/1 "2015-02-07T18:01:37Z")

</div>

I have a site that currently authenticates users successfully though the twitch API, however, I’d like the users to maintain the current url location when they authenticate. For instance, if the users URL is currently [http://mysite.com/riotgames](http://mysite.com/riotgames), I’d like, after authentication, to redirect back to that URL instead of [http://mysite.com/](http://mysite.com/)

Thanks!

---

<div class="post-metadata">

**Author:** ![george](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/george/32/120_2.png) [@george](https://discuss.dev.twitch.com/u/george)\
**Post date:** [February 7, 2015, 7:45pm UTC](https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583/2 "2015-02-07T19:45:33Z")

</div>

You can add a `state` parameter to your redirect call which is be reserved once Twitch redirects back to you.

[https://github.com/justintv/Twitch-API/blob/master/authentication.md#authorization-code-flow](https://github.com/justintv/Twitch-API/blob/master/authentication.md#authorization-code-flow) (ctrl + f “state”)

---

<div class="post-metadata">

**Author:** ![GodsVictory](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@GodsVictory](https://discuss.dev.twitch.com/u/GodsVictory)\
**Post date:** [February 7, 2015, 7:58pm UTC](https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583/3 "2015-02-07T19:58:09Z")

</div>

What if I’m using Implicit Grant Flow?

---

<div class="post-metadata">

**Author:** ![george](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/george/32/120_2.png) [@george](https://discuss.dev.twitch.com/u/george)\
**Post date:** [February 7, 2015, 8:21pm UTC](https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583/4 "2015-02-07T20:21:27Z")

</div>

I don’t think it is possible with the implicit flow.

---

<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:** [February 17, 2015, 8:22pm UTC](https://discuss.dev.twitch.com/t/authenticate-users-to-dynamic-url/1583/5 "2015-02-17T20:22:41Z")

</div>

Closed on February 17, 2015, 8:22pm UTC

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