oauthpki
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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.