oauth

package
v2.0.0-...-e071849 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Oauth

type Oauth struct {
	*context.Context
}

Oauth 平台代发起oauth2网页授权

func NewOauth

func NewOauth(context *context.Context) *Oauth

NewOauth 实例化平台代发起oauth2网页授权

func (*Oauth) GetRedirectURL

func (oauth *Oauth) GetRedirectURL(redirectURI, scope, state, appID string) (string, error)

GetRedirectURL 第三方平台 - 获取跳转的url地址

func (*Oauth) GetUserAccessToken

func (oauth *Oauth) GetUserAccessToken(code, appID, componentAccessToken string) (result officialOauth.ResAccessToken, err error)

GetUserAccessToken 第三方平台 - 通过网页授权的code 换取access_token(区别于context中的access_token)

func (*Oauth) Redirect

func (oauth *Oauth) Redirect(writer http.ResponseWriter, req *http.Request, redirectURI, scope, state, appID string) error

Redirect 第三方平台 - 跳转到网页授权

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL