Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Rocky Balboa
Rocky Balboa
19,039 Points

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

Rocky Balboa
Rocky Balboa
19,039 Points

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