Skip to content

Commit

Permalink
feat: add microsoft
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Oct 12, 2021
1 parent 1ecfdba commit 6f30dd5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ func locateHandler(method string, path string) http.HandlerFunc {
func RegisterHandlers() *http.ServeMux {
g := goic.New("/auth/o8", false)

g.NewProvider("google", "https://accounts.google.com").
WithCredential(os.Getenv("GOOGLE_CLIENT_ID"), os.Getenv("GOOGLE_CLIENT_SECRET")).
WithScope("openid email profile")
g.AddProvider(goic.Google.WithCredential(os.Getenv("GOOGLE_CLIENT_ID"), os.Getenv("GOOGLE_CLIENT_SECRET")))
g.AddProvider(goic.Microsoft.WithCredential(os.Getenv("MICROSOFT_CLIENT_ID"), os.Getenv("MICROSOFT_CLIENT_SECRET")))

g.UserCallback(func(t *goic.Token, u *goic.User, res http.ResponseWriter, req *http.Request) {
res.Header().Add("Content-Type", "application/json")
Expand Down

0 comments on commit 6f30dd5

Please sign in to comment.