Documentation ¶
Index ¶
- func GenerateEncodedState(req *http.Request, privateKeyStr string) (csrfToken, encryptedCsrfToken string, err error)
- func GenerateToken(methodEncrypt *jwt.SigningMethodECDSA, privateKeyStr string, ...) (token string, err error)
- func GetCompanyInfo(w http.ResponseWriter, r *http.Request)
- func ValidateToken(publicKeyStr string, token string) (valid bool, claims jwt.MapClaims, err error)
- type Address
- type BearerTokenResponse
- type Claims
- type Config
- func (c *Config) BasicAuth() string
- func (c *Config) CallJWKSAPI() (*JWKSResponse, error)
- func (c *Config) Connect(req *http.Request) (authUri string, encryptedCsrfToken string, err error)
- func (c *Config) RefreshToken(w http.ResponseWriter, r *http.Request)
- func (c *Config) RetrieveBearerToken(code string) (*BearerTokenResponse, error)
- func (c *Config) RevokeToken(w http.ResponseWriter, r *http.Request)
- func (c *Config) UpdateOpenIdEndpoints() (err error)
- func (c *Config) ValidateIDToken(idToken string) bool
- func (c *Config) VerifyOauth2Callback(req *http.Request) (realmId string, accessToken string, refreshToken string, intuitJWToken string, ...)
- type Header
- type JWKSResponse
- type Keys
- type OpenIdConfiguration
- type UserInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEncodedState ¶
func GenerateToken ¶
func GetCompanyInfo ¶
func GetCompanyInfo(w http.ResponseWriter, r *http.Request)
* Sample QBO API call to get CompanyInfo using OAuth2 tokens
Types ¶
type BearerTokenResponse ¶
type Config ¶
type Config struct { // Loads once ClientId string ClientSecret string RedirectUri string OpenIdConfigurationEndpoint string // Loads daily OpenIdConfiguration OpenIdConfiguration // contains filtered or unexported fields }
func GetAuthConfig ¶
func GetAuthConfig() Config
func (*Config) CallJWKSAPI ¶
func (c *Config) CallJWKSAPI() (*JWKSResponse, error)
* Call JWKS endpoint and retrieve the key values
func (*Config) RefreshToken ¶
func (c *Config) RefreshToken(w http.ResponseWriter, r *http.Request)
* Call the refresh endpoint to generate new tokens
func (*Config) RetrieveBearerToken ¶
func (c *Config) RetrieveBearerToken(code string) (*BearerTokenResponse, error)
* Method to retrive access token (bearer token)
func (*Config) RevokeToken ¶
func (c *Config) RevokeToken(w http.ResponseWriter, r *http.Request)
* Call the revoke endpoint to revoke tokens
func (*Config) UpdateOpenIdEndpoints ¶
func (*Config) ValidateIDToken ¶
type JWKSResponse ¶
type JWKSResponse struct {
KEYS []Keys `json:"keys"`
}
type OpenIdConfiguration ¶
type OpenIdConfiguration struct { Issuer string `json:"issuer"` AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` UserinfoEndpoint string `json:"userinfo_endpoint"` RevocationEndpoint string `json:"revocation_endpoint"` JwksUri string `json:"jwks_uri"` }
type UserInfoResponse ¶
type UserInfoResponse struct { Sub string `json:"sub"` Email string `json:"email"` EmailVerified bool `json:"emailVerified"` GivenName string `json:"givenName"` FamilyName string `json:"familyName"` PhoneNumber string `json:"phoneNumber"` PhoneNumberVerified bool `json:"phoneNumberVerified"` Address Address `json:"address"` }
func GetUserInfo ¶
func GetUserInfo(w http.ResponseWriter, r *http.Request, accessToken string) (*UserInfoResponse, error)
* Method to retrive userInfo - email, address, name, phone etc
Click to show internal directories.
Click to hide internal directories.