mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Updated README.md and fixed issue fetching token
This commit is contained in:
parent
74fbcc4cbc
commit
2778dacdf5
2 changed files with 4 additions and 3 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
# OpenID Connect Authentication Helper
|
# OpenID Connect Authentication Helper
|
||||||
|
|
||||||
This is a small, simple, experimental helper tool that automates the authorization code flow for logging in with an identity provider like GitHub or GitLab. To use this tool, you will have to register an OAuth2 application with you identity provider. Make sure you register the application first before proceeding, then set the callback URL to `{your host}/oauth/callback`.
|
This is a small, simple, experimental helper tool that automates the authorization code flow for logging in with an identity provider like GitHub or GitLab. This tool acts as an OAuth app, contains client secrets, and should not be exposed to users!
|
||||||
|
|
||||||
|
To use this tool, you will have to register an OAuth2 application with you identity provider. Make sure you register the application first before proceeding, then set the callback URL to `{your host}/oauth/callback`.
|
||||||
|
|
||||||
To get started with the authentication flow, run the following commands:
|
To get started with the authentication flow, run the following commands:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"davidallendj/oidc-auth/internal/util"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
@ -34,7 +33,7 @@ func FetchToken(code string, remoteUrl string, clientId string, clientSecret str
|
||||||
"client_id": {clientId},
|
"client_id": {clientId},
|
||||||
"client_secret": {clientSecret},
|
"client_secret": {clientSecret},
|
||||||
"state": {state},
|
"state": {state},
|
||||||
"redirect_uri": {util.EncodeURL(strings.Join(redirectUri, ","))},
|
"redirect_uri": {strings.Join(redirectUri, ",")},
|
||||||
}
|
}
|
||||||
res, err := http.PostForm(remoteUrl, data)
|
res, err := http.PostForm(remoteUrl, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue