Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yo-mah-ya/learning-oauth2.0
Learn How Oauth2.0 works
https://github.com/yo-mah-ya/learning-oauth2.0
golang oauth2
Last synced: about 2 months ago
JSON representation
Learn How Oauth2.0 works
- Host: GitHub
- URL: https://github.com/yo-mah-ya/learning-oauth2.0
- Owner: Yo-mah-Ya
- Created: 2023-02-25T06:04:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-19T23:00:15.000Z (about 1 year ago)
- Last Synced: 2024-05-18T07:45:34.176Z (8 months ago)
- Topics: golang, oauth2
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OAuth 2.0
Details
[RFC6749](https://www.rfc-editor.org/rfc/rfc6749)## Authorization Code Grant
1. Authentication endpoint
1. Request to Authentication endpoint
```http
GET {Authentication endpoint}
?response_type=code // necessary
&client_id={client_id} // necessary
&redirect_uri={redirect_uri} // necessary depending on conditions
&scope={scope} // option
&state={any string} // recommended
&code_challenge={challenge} // option
&code_challege_method={method} // option
HTTP/1.1
HOST: {Authentication Server}
```2. Response from Authentication endpoint
```http
HTTP/1.1 302 Found
Location: {redirect_uri}
?code={authenticated code} // necessary
&state={any string} // necessary If request has a "state"
```3. Request to token endpoint
```http
POST {token endpoint} HTTP/1.1
Host: {Authentication server}
Content-Type: application/x-www-form-urlencodedgrant_type=authorization_code // necessary
&code={authenticated code} // necessary to specify the value which is in the response of Authentication endpoint
&redirect_uri={redirect_uri} // necessary If Authentication request has a redirect_uri
&code_verifier={verifier} // necessary If Authentication request has a code_challenge
```## Implicit Grant
## Resource Owner Password Credentials Grant
## Client Credentials Grant