OAuth2.0 Implicit Flow CORS Error

48 views
Skip to first unread message

Jake Garris

unread,
Feb 26, 2018, 10:42:44 AM2/26/18
to Meetup API
I was hoping to get a hand with an issue I'm having with the Implicit Flow implementation for OAuth 2.0. I have been pouring over the documentation for authenticating and making OAuth authenticated requests, but I am still coming up short on CORS. For context, I am trying to integrate this API with an Angular 5 application.


I have registered my consumer on meetup and set the Redirect URI to be "http://localhost:4200". This should redirect from authentication back to my local dev server. I am able to redirect to "https://secure.meetup.com/oauth2/authorize?..." with all of the correct parameters. This appears to be working. Once on the Meetup site, I click to allow my application access to my credentials and I am redirected back to my site, localhost:4200.

From there I have a component that pulls my access token out of the URL fragment that came in as part of the last redirect. Using that token the component calls a service to make a request to the meetup API. So far every request I have tried has failed.

Here is the code that I have making the call to Meetup

let headers: HttpHeaders = new HttpHeaders();
headers
= headers.set('Authorization', `Bearer ${this.accessToken}`);
const url = 'https://api.meetup.com/2/member/self/';
return this.http.get( url, { headers: headers } );

My understanding from the documentation is because my Redirect URI is "localhost:4200", any request originating from localhost:4200/* should be accepted by CORS with my authentication.

Every request that I make comes back with the below error. Any ideas on what I am missing or how to resolve this?

Thanks!


Reply all
Reply to author
Forward
0 new messages