gitea: code.gitea.io/gitea/modules/auth/oauth2 Index | Files

package oauth2

import "code.gitea.io/gitea/modules/auth/oauth2"

Index

Package Files

oauth2.go

func Auth Uses

func Auth(provider string, request *http.Request, response http.ResponseWriter) error

Auth OAuth2 auth service

func GetDefaultAuthURL Uses

func GetDefaultAuthURL(provider string) string

GetDefaultAuthURL return the default authorize url for the given provider

func GetDefaultEmailURL Uses

func GetDefaultEmailURL(provider string) string

GetDefaultEmailURL return the default email url for the given provider

func GetDefaultProfileURL Uses

func GetDefaultProfileURL(provider string) string

GetDefaultProfileURL return the default profile url for the given provider

func GetDefaultTokenURL Uses

func GetDefaultTokenURL(provider string) string

GetDefaultTokenURL return the default token url for the given provider

func Init Uses

func Init(x *xorm.Engine) error

Init initialize the setup of the OAuth2 library

func ProviderCallback Uses

func ProviderCallback(provider string, request *http.Request, response http.ResponseWriter) (goth.User, error)

ProviderCallback handles OAuth callback, resolve to a goth user and send back to original url this will trigger a new authentication request, but because we save it in the session we can use that

func RegisterProvider Uses

func RegisterProvider(providerName, providerType, clientID, clientSecret, openIDConnectAutoDiscoveryURL string, customURLMapping *CustomURLMapping) error

RegisterProvider register a OAuth2 provider in goth lib

func RemoveProvider Uses

func RemoveProvider(providerName string)

RemoveProvider removes the given OAuth2 provider from the goth lib

type CustomURLMapping Uses

type CustomURLMapping struct {
    AuthURL    string
    TokenURL   string
    ProfileURL string
    EmailURL   string
}

CustomURLMapping describes the urls values to use when customizing OAuth2 provider URLs

Package oauth2 imports 19 packages (graph) and is imported by 13 packages. Updated 2019-09-15. Refresh now. Tools for package owners.