I am working on being able to have my custom chat bot to update my primary channel's title (status). I am following [this](https://discuss.dev.twitch.tv/t/how-to-set-title/390) post and I am trying to get the `access_token` from the `REDIRECT_URI`.

The URI that contains the redirect is: 

```
https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&scope=channel_editor

```

I have manually tested this with my `CLIENT_ID` and `REDIRECT_URI` set to `http://localhost` and I get this response from the above URI (which is what I want): 

```
http://localhost/#access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&scope=channel_editor

```

I am trying to get the `access_token` from this URI, but I cant seem to get to it from the code below. My response is: 

```
https://api.twitch.tv/kraken/oauth2/authenticate?action=authorize&client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&redirect_uri=http%3A%2F%2Flocalhost&response_type=token&scope=channel_editor

```

**Code:**

```
string clientID = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
string redirectURL = "http://localhost";

string url = string.Format("https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id={0}&redirect_uri={1}&scope=channel_editor",
                 clientID, redirectURL);

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AllowAutoRedirect = false;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string redirUrl = response.Headers["Location"];
response.Close();

// Show the redirected url
Console.WriteLine("You're being redirected to: " + redirUrl);

```

This is a console application