Movatterモバイル変換


[0]ホーム

URL:


oauthpki

package
v2.23.1Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License:AGPL-3.0Imports:18Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeConfig

type Config struct {// contains filtered or unexported fields}

Config uses jwt assertions over client_secret for oauth2 authentication ofthe application. This implementation was made specifically for Azure AD.

https://learn.microsoft.com/en-us/azure/active-directory/develop/certificate-credentials

However this does mostly follow the standard. We can generalize this as weinclude support for more IDPs.

https://datatracker.ietf.org/doc/html/rfc7523

funcNewOauth2PKIConfig

func NewOauth2PKIConfig(paramsConfigParams) (*Config,error)

NewOauth2PKIConfig creates the oauth2 config for PKI based auth. It requires the certificate and it's private key.The values should be passed in as PEM encoded values, which is the standard encoding for x509 certs saved to disk.It should look like:

-----BEGIN RSA PRIVATE KEY----...-----END RSA PRIVATE KEY-----

-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----

func (*Config)AuthCodeURL

func (ja *Config) AuthCodeURL(statestring, opts ...oauth2.AuthCodeOption)string

func (*Config)Exchange

func (ja *Config) Exchange(ctxcontext.Context, codestring, opts ...oauth2.AuthCodeOption) (*oauth2.Token,error)

Exchange includes the client_assertion signed JWT.

func (*Config)TokenSource

func (ja *Config) TokenSource(ctxcontext.Context, token *oauth2.Token)oauth2.TokenSource

typeConfigParams

type ConfigParams struct {ClientIDstringTokenURLstringScopes         []stringPemEncodedKey  []bytePemEncodedCert []byteConfigpromoauth.OAuth2Config}

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