Movatterモバイル変換


[0]ホーム

URL:


stsexchange

package
v0.34.0Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License:BSD-3-ClauseImports:10Imported by:0

Details

Repository

cs.opensource.google/go/x/oauth2

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeClientAuthentication

type ClientAuthentication struct {// AuthStyle can be either basic or request-bodyAuthStyleoauth2.AuthStyleClientIDstringClientSecretstring}

ClientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1.

func (*ClientAuthentication)InjectAuthentication

func (c *ClientAuthentication) InjectAuthentication(valuesurl.Values, headershttp.Header)

InjectAuthentication is used to add authentication to a Secure Token Service exchangerequest. It modifies either the passed url.Values or http.Header depending on the desiredauthentication format.

typeResponse

type Response struct {AccessTokenstring `json:"access_token"`IssuedTokenTypestring `json:"issued_token_type"`TokenTypestring `json:"token_type"`ExpiresInint    `json:"expires_in"`Scopestring `json:"scope"`RefreshTokenstring `json:"refresh_token"`}

Response is used to decode the remote server response during an oauth2 token exchange.

funcExchangeToken

func ExchangeToken(ctxcontext.Context, endpointstring, request *TokenExchangeRequest, authenticationClientAuthentication, headershttp.Header, options map[string]any) (*Response,error)

ExchangeToken performs an oauth2 token exchange with the provided endpoint.The first 4 fields are all mandatory. headers can be used to pass additionalheaders beyond the bare minimum required by the token exchange. options canbe used to pass additional JSON-structured options to the remote server.

funcRefreshAccessToken

func RefreshAccessToken(ctxcontext.Context, endpointstring, refreshTokenstring, authenticationClientAuthentication, headershttp.Header) (*Response,error)

typeTokenExchangeRequest

type TokenExchangeRequest struct {ActingParty struct {ActorTokenstringActorTokenTypestring}GrantTypestringResourcestringAudiencestringScope              []stringRequestedTokenTypestringSubjectTokenstringSubjectTokenTypestring}

TokenExchangeRequest contains fields necessary to make an oauth2 token exchange.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp