![]() ![]() This code can be used to get an access token. The authorization code is a code that Google sends back to your app once the user consents on this screen. This kind of similar terminology can be tricky at first, so let's first briefly cover what they are. They both take the form of long strings, but have different purposes. The first request is to get an authorization code, the second is to get an access token. In the OAuth flow, your app needs to send two requests to Google. What are authorization codes and access tokens? In other words, if you already know how it works and can understand Google's OAuth guide, this post may be too elementary for you. This post is meant for people who are not very familiar with OAuth. I decided to re-implement the flow without the help of any authentication helper gems.īased on what I learned, I wrote this basic explanation of the OAuth flow and what authorization codes and access/refresh tokens are. Yet as soon as I wanted to customize something, I realized it was necessary to have a better understanding of it. When I implemented OAuth in Rails for the first time, I was using an external library (the sorcery gem’s external module), which made it easy for me to gloss over the process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |