Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config uses jwt assertions over client_secret for oauth2 authentication of the 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 we include support for more IDPs.
https://datatracker.ietf.org/doc/html/rfc7523
func NewOauth2PKIConfig ¶
func NewOauth2PKIConfig(params ConfigParams) (*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(state string, opts ...oauth2.AuthCodeOption) string
func (*Config) Exchange ¶
func (ja *Config) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
Exchange includes the client_assertion signed JWT.