Example #1
0
// Returns a generic OAuth 2.0 backend endpoint.
func NewOAuth2Provider(opts *OAuth2Options, authUrl, tokenUrl string) Middleware {
	options := &oauth2.Config{
		ClientID:     opts.ClientID,
		ClientSecret: opts.ClientSecret,
		RedirectURL:  opts.RedirectURL,
		Scopes:       opts.Scopes,
	}
	return oauth2.NewOAuth2Provider(options, authUrl, tokenUrl)
}
Example #2
0
func KeyCloak(config *oauth2.Config) negroni.Handler {
	authUrl := "http://indiadevres3.cloudapp.net:8080/auth/realms/Waygum/protocol/openid-connect/auth"
	tokenUrl := "http://indiadevres3.cloudapp.net:8080/auth/realms/Waygum/protocol/openid-connect/token"
	return oauth2.NewOAuth2Provider(config, authUrl, tokenUrl)
}