Twitch API Login Integration Failing

Hey all! I am attempting to integrate the Twitch API Oauth flow into an existing website in order to enable Twitch Logins via button.

So far, I have a Code response working. However, I try to take the data from the response,
use the access_token as apparently recommended and validate that, and everything I’ve tried returns 401 - missing Authorization. At this point, I’m baffled.

This is the code - from Angular 6 and TypeScript, that I currently have for the Validation proccess:

    this.validateSub = this.auth.validateTwitchUser(access_token).subscribe(val => {
      console.log(val);
    })

  validateTwitchUser(authCode)
  {
      let httpOptions = {
          headers: new HttpHeaders({
          "Authorization" : 'OAuth ' + authCode
       })};
       let URL = "https://id.twitch.tv/oauth2/validate";

       return this.http.get(URL, httpOptions); 
  } 

As far as I can tell, the correct token is being sent, but it’s not accepted. What should be fixed here?

Whoops, I made a couple mistakes. Primarily, the flow should be on the “Server” proper after the Code has been granted. I was taking it to read “server” as in where the client was hosted.

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