Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

oauth2 with javascript

Hi All,

Question: I need to do oauth 2 on the client side, however i'm not really understanding the process of how it actually works, can anyone recommend a guide or step by step process on how this can be done?

I need to Send an authentication request using url Exchange code for access token and ID token Obtain user information from the ID token via JSON

Much Thanks if anyone can help!

2 Answers

Stephen Gheysens
Stephen Gheysens
11,935 Points

Hi, here's the official OAuth 2.0 Getting Started guide for the Javascript library: https://github.com/andreassolberg/jso/blob/master/README-getting-started.md

I would also recommend considering using a service like Auth0 that has a lot of doucmentation and easily supports different protocols, and many sign-in services out of the box: https://auth0.com/docs/protocols

Thanks for the reply, but can it be done using only Javascript no Javascript library?