Documentation ¶
Index ¶
- Constants
- func GetOSPlatform() string
- func GetOSVersion() string
- type Account
- type AuthParametersInternal
- func (ap *AuthParametersInternal) GetAuthorityEndpoints() *AuthorityEndpoints
- func (ap *AuthParametersInternal) GetAuthorityInfo() *AuthorityInfo
- func (ap *AuthParametersInternal) GetAuthorizationType() AuthorizationType
- func (ap *AuthParametersInternal) GetClientID() string
- func (ap *AuthParametersInternal) GetCorrelationID() string
- func (ap *AuthParametersInternal) GetHomeAccountID() string
- func (ap *AuthParametersInternal) GetPassword() string
- func (ap *AuthParametersInternal) GetRedirectURI() string
- func (ap *AuthParametersInternal) GetScopes() []string
- func (ap *AuthParametersInternal) GetUsername() string
- func (ap *AuthParametersInternal) SetAuthorityEndpoints(authorityEndpoints *AuthorityEndpoints)
- func (ap *AuthParametersInternal) SetAuthorizationType(authType AuthorizationType)
- func (ap *AuthParametersInternal) SetPassword(password string)
- func (ap *AuthParametersInternal) SetScopes(scopes []string)
- func (ap *AuthParametersInternal) SetUsername(username string)
- type AuthenticationResult
- func (ar *AuthenticationResult) GetAccessToken() string
- func (ar *AuthenticationResult) GetAccount() *Account
- func (ar *AuthenticationResult) GetDeclinedScopes() []string
- func (ar *AuthenticationResult) GetExpiresOn() time.Time
- func (ar *AuthenticationResult) GetGrantedScopes() []string
- func (ar *AuthenticationResult) GetIdToken() string
- type AuthorityEndpoints
- type AuthorityInfo
- func (i *AuthorityInfo) GetAuthorityType() AuthorityType
- func (i *AuthorityInfo) GetCanonicalAuthorityURI() string
- func (i *AuthorityInfo) GetHost() string
- func (i *AuthorityInfo) GetUserRealmURIPrefix() string
- func (i *AuthorityInfo) GetValidateAuthority() bool
- func (i *AuthorityInfo) Tenant() string
- type AuthorityType
- type AuthorizationType
- type ClientCertificate
- type Credential
- func CreateCredentialAccessToken(homeAccountID string, environment string, realm string, clientID string, ...) *Credential
- func CreateCredentialIdToken(homeAccountID string, environment string, realm string, clientID string, ...) *Credential
- func CreateCredentialRefreshToken(homeAccountID string, environment string, clientID string, cachedAt int64, ...) *Credential
- type CredentialType
- type DeviceCodeResult
- func (dcr *DeviceCodeResult) GetClientID() string
- func (dcr *DeviceCodeResult) GetDeviceCode() string
- func (dcr *DeviceCodeResult) GetExpiresOn() time.Time
- func (dcr *DeviceCodeResult) GetInterval() int
- func (dcr *DeviceCodeResult) GetMessage() string
- func (dcr *DeviceCodeResult) GetScopes() []string
- func (dcr *DeviceCodeResult) GetUserCode() string
- func (dcr *DeviceCodeResult) GetVerificationURL() string
- func (r DeviceCodeResult) String() string
- type HTTPManager
- type HTTPManagerResponse
- type ICacheManager
- type IDToken
- func (t *IDToken) GetAlternativeId() string
- func (t *IDToken) GetFamilyName() string
- func (t *IDToken) GetGivenName() string
- func (t *IDToken) GetMiddleName() string
- func (t *IDToken) GetName() string
- func (t *IDToken) GetPreferredUsername() string
- func (t *IDToken) GetRaw() string
- func (t *IDToken) IsEmpty() bool
- type OAuthResponseBase
- type StorageTokenResponse
- type TokenResponse
- func (tr *TokenResponse) GetAccessToken() string
- func (tr *TokenResponse) GetDeclinedScopes() []string
- func (tr *TokenResponse) GetExpiresOn() time.Time
- func (tr *TokenResponse) GetExtendedExpiresOn() time.Time
- func (tr *TokenResponse) GetGrantedScopes() []string
- func (tr *TokenResponse) GetIDToken() *IDToken
- func (tr *TokenResponse) GetRawClientInfo() string
- func (tr *TokenResponse) GetRefreshToken() string
- func (tr *TokenResponse) HasAccessToken() bool
- func (tr *TokenResponse) HasRefreshToken() bool
- func (tr *TokenResponse) IsAuthorizationPending() bool
- type UserRealm
- type UserRealmAccountType
Constants ¶
View Source
const ( AuthorizationTypeNone AuthorizationType = iota AuthorizationTypeUsernamePassword = iota AuthorizationTypeWindowsIntegratedAuth = iota AuthorizationTypeAuthCode = iota AuthorizationTypeInteractive = iota AuthorizationTypeCertificate = iota AuthorizationTypeDeviceCode = iota AuthorizationTypeRefreshTokenExchange = iota )
Variables ¶
This section is empty.
Functions ¶
func GetOSPlatform ¶
func GetOSPlatform() string
func GetOSVersion ¶
func GetOSVersion() string
Types ¶
type Account ¶
type Account struct { }
func CreateAccount ¶
func CreateAccount(homeAccountID string, environment string, realm string, localAccountID string, authorityType AuthorityType, preferredUsername string, givenName string, familyName string, middleName string, name string, alternativeID string, rawClientInfo string, additionalFieldsJSON string) *Account
type AuthParametersInternal ¶
type AuthParametersInternal struct {
// contains filtered or unexported fields
}
func CreateAuthParametersInternal ¶
func CreateAuthParametersInternal(clientID string, authorityInfo *AuthorityInfo) *AuthParametersInternal
func (*AuthParametersInternal) GetAuthorityEndpoints ¶
func (ap *AuthParametersInternal) GetAuthorityEndpoints() *AuthorityEndpoints
func (*AuthParametersInternal) GetAuthorityInfo ¶
func (ap *AuthParametersInternal) GetAuthorityInfo() *AuthorityInfo
func (*AuthParametersInternal) GetAuthorizationType ¶
func (ap *AuthParametersInternal) GetAuthorizationType() AuthorizationType
func (*AuthParametersInternal) GetClientID ¶
func (ap *AuthParametersInternal) GetClientID() string
func (*AuthParametersInternal) GetCorrelationID ¶
func (ap *AuthParametersInternal) GetCorrelationID() string
func (*AuthParametersInternal) GetHomeAccountID ¶
func (ap *AuthParametersInternal) GetHomeAccountID() string
func (*AuthParametersInternal) GetPassword ¶
func (ap *AuthParametersInternal) GetPassword() string
func (*AuthParametersInternal) GetRedirectURI ¶
func (ap *AuthParametersInternal) GetRedirectURI() string
func (*AuthParametersInternal) GetScopes ¶
func (ap *AuthParametersInternal) GetScopes() []string
func (*AuthParametersInternal) GetUsername ¶
func (ap *AuthParametersInternal) GetUsername() string
func (*AuthParametersInternal) SetAuthorityEndpoints ¶
func (ap *AuthParametersInternal) SetAuthorityEndpoints(authorityEndpoints *AuthorityEndpoints)
func (*AuthParametersInternal) SetAuthorizationType ¶
func (ap *AuthParametersInternal) SetAuthorizationType(authType AuthorizationType)
func (*AuthParametersInternal) SetPassword ¶
func (ap *AuthParametersInternal) SetPassword(password string)
func (*AuthParametersInternal) SetScopes ¶
func (ap *AuthParametersInternal) SetScopes(scopes []string)
func (*AuthParametersInternal) SetUsername ¶
func (ap *AuthParametersInternal) SetUsername(username string)
type AuthenticationResult ¶
type AuthenticationResult struct {
// contains filtered or unexported fields
}
AuthenticationResult contains the results of one token acquisition operation in PublicClientApplication or ConfidentialClientApplication. For details see https://aka.ms/msal-net-authenticationresult
func CreateAuthenticationResult ¶
func CreateAuthenticationResult(tokenResponse *TokenResponse, account *Account) *AuthenticationResult
CreateAuthenticationResult creates and AuthenticationResult. This should only be called from internal code.
func CreateAuthenticationResultFromStorageTokenResponse ¶
func CreateAuthenticationResultFromStorageTokenResponse(storageTokenResponse *StorageTokenResponse) (*AuthenticationResult, error)
func (*AuthenticationResult) GetAccessToken ¶
func (ar *AuthenticationResult) GetAccessToken() string
GetAccessToken retrieves the access token string from the result.
func (*AuthenticationResult) GetAccount ¶
func (ar *AuthenticationResult) GetAccount() *Account
func (*AuthenticationResult) GetDeclinedScopes ¶
func (ar *AuthenticationResult) GetDeclinedScopes() []string
func (*AuthenticationResult) GetExpiresOn ¶
func (ar *AuthenticationResult) GetExpiresOn() time.Time
func (*AuthenticationResult) GetGrantedScopes ¶
func (ar *AuthenticationResult) GetGrantedScopes() []string
func (*AuthenticationResult) GetIdToken ¶
func (ar *AuthenticationResult) GetIdToken() string
type AuthorityEndpoints ¶
type AuthorityEndpoints struct {
// contains filtered or unexported fields
}
func CreateAuthorityEndpoints ¶
func CreateAuthorityEndpoints(authorizationEndpoint string, tokenEndpoint string, selfSignedJwtAudience string, authorityHost string) *AuthorityEndpoints
func (*AuthorityEndpoints) GetAuthorizationEndpoint ¶
func (endpoints *AuthorityEndpoints) GetAuthorizationEndpoint() string
func (*AuthorityEndpoints) GetTokenEndpoint ¶
func (endpoints *AuthorityEndpoints) GetTokenEndpoint() string
func (*AuthorityEndpoints) GetUserRealmEndpoint ¶
func (endpoints *AuthorityEndpoints) GetUserRealmEndpoint(username string) string
type AuthorityInfo ¶
type AuthorityInfo struct {
// contains filtered or unexported fields
}
func CreateAuthorityInfoFromAuthorityUri ¶
func CreateAuthorityInfoFromAuthorityUri(authorityURI string, validateAuthority bool) (*AuthorityInfo, error)
func (*AuthorityInfo) GetAuthorityType ¶
func (i *AuthorityInfo) GetAuthorityType() AuthorityType
func (*AuthorityInfo) GetCanonicalAuthorityURI ¶
func (i *AuthorityInfo) GetCanonicalAuthorityURI() string
func (*AuthorityInfo) GetHost ¶
func (i *AuthorityInfo) GetHost() string
func (*AuthorityInfo) GetUserRealmURIPrefix ¶
func (i *AuthorityInfo) GetUserRealmURIPrefix() string
func (*AuthorityInfo) GetValidateAuthority ¶
func (i *AuthorityInfo) GetValidateAuthority() bool
func (*AuthorityInfo) Tenant ¶
func (i *AuthorityInfo) Tenant() string
type AuthorityType ¶
type AuthorityType int
const ( AuthorityTypeNone AuthorityType = iota AuthorityTypeAad AuthorityTypeAdfs AuthorityTypeB2C )
type AuthorizationType ¶
type AuthorizationType int
type ClientCertificate ¶
type ClientCertificate struct { }
type Credential ¶
type Credential struct {
// contains filtered or unexported fields
}
func CreateCredentialIdToken ¶
func (*Credential) GetCredentialType ¶
func (c *Credential) GetCredentialType() CredentialType
func (*Credential) GetExpiresOn ¶
func (c *Credential) GetExpiresOn() int64
func (*Credential) GetScopes ¶
func (c *Credential) GetScopes() string
func (*Credential) GetSecret ¶
func (c *Credential) GetSecret() string
type CredentialType ¶
type CredentialType int
const ( CredentialTypeOauth2RefreshToken CredentialType = iota CredentialTypeOauth2AccessToken CredentialTypeOidcIDToken CredentialTypeOther )
type DeviceCodeResult ¶
type DeviceCodeResult struct {
// contains filtered or unexported fields
}
func CreateDeviceCodeResult ¶
func (*DeviceCodeResult) GetClientID ¶
func (dcr *DeviceCodeResult) GetClientID() string
func (*DeviceCodeResult) GetDeviceCode ¶
func (dcr *DeviceCodeResult) GetDeviceCode() string
func (*DeviceCodeResult) GetExpiresOn ¶
func (dcr *DeviceCodeResult) GetExpiresOn() time.Time
func (*DeviceCodeResult) GetInterval ¶
func (dcr *DeviceCodeResult) GetInterval() int
func (*DeviceCodeResult) GetMessage ¶
func (dcr *DeviceCodeResult) GetMessage() string
func (*DeviceCodeResult) GetScopes ¶
func (dcr *DeviceCodeResult) GetScopes() []string
func (*DeviceCodeResult) GetUserCode ¶
func (dcr *DeviceCodeResult) GetUserCode() string
func (*DeviceCodeResult) GetVerificationURL ¶
func (dcr *DeviceCodeResult) GetVerificationURL() string
func (DeviceCodeResult) String ¶
func (r DeviceCodeResult) String() string
type HTTPManager ¶
type HTTPManager struct {
// contains filtered or unexported fields
}
HTTPManager stuff
func (*HTTPManager) Get ¶
func (mgr *HTTPManager) Get(url string, requestHeaders map[string]string) (*HTTPManagerResponse, error)
Get stuff
func (*HTTPManager) Post ¶
func (mgr *HTTPManager) Post(url string, body string, requestHeaders map[string]string) (*HTTPManagerResponse, error)
Post stuff
type HTTPManagerResponse ¶
type HTTPManagerResponse struct {
// contains filtered or unexported fields
}
HTTPManagerResponse stuff
func CreateHTTPManagerResponse ¶
func CreateHTTPManagerResponse(resp *http.Response) (*HTTPManagerResponse, error)
CreateHTTPManagerResponse stuff
func (*HTTPManagerResponse) GetHeaders ¶
func (r *HTTPManagerResponse) GetHeaders() map[string]string
GetHeaders stuff
func (*HTTPManagerResponse) GetResponseCode ¶
func (r *HTTPManagerResponse) GetResponseCode() int
GetResponseCode stuff
func (*HTTPManagerResponse) GetResponseData ¶
func (r *HTTPManagerResponse) GetResponseData() string
GetResponseData stuff
type ICacheManager ¶
type ICacheManager interface { TryReadCache(authParameters *AuthParametersInternal) (*StorageTokenResponse, error) CacheTokenResponse(authParameters *AuthParametersInternal, tokenResponse *TokenResponse) (*Account, error) DeleteCachedRefreshToken(authParameters *AuthParametersInternal) error }
type IDToken ¶
type IDToken struct { PreferredUsername string `json:"preferred_username,omitempty"` GivenName string `json:"given_name,omitempty"` FamilyName string `json:"family_name,omitempty"` MiddleName string `json:"middle_name,omitempty"` Name string `json:"name,omitempty"` Oid string `json:"oid,omitempty"` TenantID string `json:"tenant_id,omitempty"` Subject string `json:"subject,omitempty"` UPN string `json:"upn,omitempty"` Email string `json:"email,omitempty"` AlternativeID string `json:"alternative_id,omitempty"` }
func CreateIDToken ¶
func (*IDToken) GetAlternativeId ¶
func (*IDToken) GetFamilyName ¶
func (*IDToken) GetGivenName ¶
func (*IDToken) GetMiddleName ¶
func (*IDToken) GetPreferredUsername ¶
type OAuthResponseBase ¶
type OAuthResponseBase struct { Error string `json:"error"` SubError string `json:"suberror"` ErrorDescription string `json:"error_description"` ErrorCodes []int `json:"error_codes"` CorrelationID string `json:"correlation_id"` Claims string `json:"claims"` }
func CreateOAuthResponseBase ¶
func CreateOAuthResponseBase(httpStatusCode int, responseData string) (*OAuthResponseBase, error)
type StorageTokenResponse ¶
type StorageTokenResponse struct {
// contains filtered or unexported fields
}
func CreateStorageTokenResponse ¶
func CreateStorageTokenResponse(accessToken *Credential, refreshToken *Credential, idToken *Credential, account *Account) *StorageTokenResponse
type TokenResponse ¶
type TokenResponse struct {
// contains filtered or unexported fields
}
func CreateTokenResponse ¶
func CreateTokenResponse(authParameters *AuthParametersInternal, responseCode int, responseData string) (*TokenResponse, error)
func CreateTokenResponseFromParts ¶
func CreateTokenResponseFromParts(idToken *IDToken, accessToken *Credential, refreshToken *Credential) (*TokenResponse, error)
func (*TokenResponse) GetAccessToken ¶
func (tr *TokenResponse) GetAccessToken() string
func (*TokenResponse) GetDeclinedScopes ¶
func (tr *TokenResponse) GetDeclinedScopes() []string
func (*TokenResponse) GetExpiresOn ¶
func (tr *TokenResponse) GetExpiresOn() time.Time
func (*TokenResponse) GetExtendedExpiresOn ¶
func (tr *TokenResponse) GetExtendedExpiresOn() time.Time
func (*TokenResponse) GetGrantedScopes ¶
func (tr *TokenResponse) GetGrantedScopes() []string
func (*TokenResponse) GetIDToken ¶
func (tr *TokenResponse) GetIDToken() *IDToken
func (*TokenResponse) GetRawClientInfo ¶
func (tr *TokenResponse) GetRawClientInfo() string
func (*TokenResponse) GetRefreshToken ¶
func (tr *TokenResponse) GetRefreshToken() string
func (*TokenResponse) HasAccessToken ¶
func (tr *TokenResponse) HasAccessToken() bool
func (*TokenResponse) HasRefreshToken ¶
func (tr *TokenResponse) HasRefreshToken() bool
func (*TokenResponse) IsAuthorizationPending ¶
func (tr *TokenResponse) IsAuthorizationPending() bool
type UserRealm ¶
type UserRealm struct { AccountType string `json:"account_type"` DomainName string `json:"domain_name"` CloudInstanceNmae string `json:"cloud_instance_name"` CloudAudienceURN string `json:"cloud_audience_urn"` // required if accountType is Federated FederationProtocol string `json:"federation_protocol"` FederationMetadataURL string `json:"federation_metadata_url"` }
func CreateUserRealm ¶
CreateUserRealm stuff
func (*UserRealm) GetAccountType ¶
func (u *UserRealm) GetAccountType() UserRealmAccountType
func (*UserRealm) GetCloudAudienceURN ¶
func (*UserRealm) GetFederationMetadataURL ¶
type UserRealmAccountType ¶
type UserRealmAccountType int
const ( Unknown UserRealmAccountType = iota Federated Managed )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.