Documentation
¶
Index ¶
- Constants
- func Ensure(ctx context.Context, home string) (string, error)
- func LibraryName() (string, bool)
- func LibraryPath(home string) (string, bool)
- type Account
- func (a *Account) AccountID() (string, error)
- func (a *Account) AdditionalFieldsJSON() (string, error)
- func (a *Account) ClientInfo() (string, error)
- func (a *Account) DisplayName() (string, error)
- func (a *Account) Environment() (string, error)
- func (a *Account) FamilyName() (string, error)
- func (a *Account) GivenName() (string, error)
- func (a *Account) HomeAccountID() (string, error)
- func (a *Account) HomeEnvironment() (string, error)
- func (a *Account) LocalAccountID() (string, error)
- func (a *Account) MiddleName() (string, error)
- func (a *Account) Realm() (string, error)
- func (a *Account) Release()
- func (a *Account) UserName() (string, error)
- type AuthParameters
- func (p *AuthParameters) Release()
- func (p *AuthParameters) SetAccessTokenToRenew(token string) error
- func (p *AuthParameters) SetAdditionalParameter(key, value string) error
- func (p *AuthParameters) SetDecodedClaims(claims string) error
- func (p *AuthParameters) SetPopParams(method, host, path, nonce string) error
- func (p *AuthParameters) SetRedirectURI(uri string) error
- func (p *AuthParameters) SetRequestedScopes(scopes []string) error
- type AuthResult
- func (a *AuthResult) AccessToken() (string, error)
- func (a *AuthResult) Account() (*Account, error)
- func (a *AuthResult) AuthorizationHeader() (string, error)
- func (a *AuthResult) ExpiresOn() (int64, error)
- func (a *AuthResult) Failure() (*Error, error)
- func (a *AuthResult) GrantedScopes() ([]string, error)
- func (a *AuthResult) IDToken() (string, error)
- func (a *AuthResult) IsPopAuthorization() (bool, error)
- func (a *AuthResult) RawIDToken() (string, error)
- func (a *AuthResult) Release()
- func (a *AuthResult) Telemetry() (map[string]string, error)
- type DiscoverAccountsResult
- type Error
- type LoadError
- type LogLevel
- type ReadAccountResult
- type Runtime
- func (r *Runtime) AcquireTokenInteractively(ctx context.Context, parent WindowHandle, params *AuthParameters, ...) (*AuthResult, error)
- func (r *Runtime) AcquireTokenSilently(ctx context.Context, params *AuthParameters, correlationID string, ...) (*AuthResult, error)
- func (r *Runtime) DiscoverAccounts(ctx context.Context, clientID, correlationID string) (*DiscoverAccountsResult, error)
- func (r *Runtime) NewAuthParameters(clientID, authority string) (*AuthParameters, error)
- func (r *Runtime) ReadAccountByID(ctx context.Context, accountID, correlationID string) (*ReadAccountResult, error)
- func (r *Runtime) SetIsPIIEnabled(enabled bool)
- func (r *Runtime) Shutdown()
- func (r *Runtime) SignIn(ctx context.Context, parent WindowHandle, params *AuthParameters, ...) (*AuthResult, error)
- func (r *Runtime) SignInInteractively(ctx context.Context, parent WindowHandle, params *AuthParameters, ...) (*AuthResult, error)
- func (r *Runtime) SignInSilently(ctx context.Context, params *AuthParameters, correlationID string) (*AuthResult, error)
- func (r *Runtime) SignOutSilently(ctx context.Context, clientID, correlationID string, account *Account) (*SignOutResult, error)
- type SignOutResult
- type StartupError
- type Status
- type WindowHandle
Constants ¶
const Version = "0.20.7"
Version of the msalruntime release whose native library this binding drives
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure returns the native library under an icebath home, fetching the pinned archive and extracting the library when it is absent or altered
func LibraryName ¶
Native library file Microsoft publishes for this OS and architecture, false where none is published
func LibraryPath ¶
LibraryPath is where the native library of this platform lives under an icebath home
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
MSALRUNTIME_ACCOUNT_HANDLE with its getters
func (*Account) AdditionalFieldsJSON ¶
func (*Account) ClientInfo ¶
func (*Account) DisplayName ¶
func (*Account) Environment ¶
func (*Account) FamilyName ¶
func (*Account) HomeAccountID ¶
func (*Account) HomeEnvironment ¶
func (*Account) LocalAccountID ¶
func (*Account) MiddleName ¶
type AuthParameters ¶
type AuthParameters struct {
// contains filtered or unexported fields
}
MSALRUNTIME_AUTH_PARAMETERS_HANDLE with its setters
func (*AuthParameters) SetAccessTokenToRenew ¶
func (p *AuthParameters) SetAccessTokenToRenew(token string) error
func (*AuthParameters) SetAdditionalParameter ¶
func (p *AuthParameters) SetAdditionalParameter(key, value string) error
func (*AuthParameters) SetDecodedClaims ¶
func (p *AuthParameters) SetDecodedClaims(claims string) error
func (*AuthParameters) SetPopParams ¶
func (p *AuthParameters) SetPopParams(method, host, path, nonce string) error
Proof of possession request shape, the method, host, path and nonce the signed request binds
func (*AuthParameters) SetRedirectURI ¶
func (p *AuthParameters) SetRedirectURI(uri string) error
func (*AuthParameters) SetRequestedScopes ¶
func (p *AuthParameters) SetRequestedScopes(scopes []string) error
Requested scopes, joined with spaces into the single string the C API takes
type AuthResult ¶
type AuthResult struct {
// contains filtered or unexported fields
}
MSALRUNTIME_AUTH_RESULT_HANDLE with its getters
func (*AuthResult) AccessToken ¶
func (a *AuthResult) AccessToken() (string, error)
func (*AuthResult) Account ¶
func (a *AuthResult) Account() (*Account, error)
func (*AuthResult) AuthorizationHeader ¶
func (a *AuthResult) AuthorizationHeader() (string, error)
func (*AuthResult) ExpiresOn ¶
func (a *AuthResult) ExpiresOn() (int64, error)
Access token expiry as epoch seconds
func (*AuthResult) Failure ¶
func (a *AuthResult) Failure() (*Error, error)
func (*AuthResult) GrantedScopes ¶
func (a *AuthResult) GrantedScopes() ([]string, error)
Granted scopes split on spaces, empty when the runtime reports none
func (*AuthResult) IDToken ¶
func (a *AuthResult) IDToken() (string, error)
func (*AuthResult) IsPopAuthorization ¶
func (a *AuthResult) IsPopAuthorization() (bool, error)
func (*AuthResult) RawIDToken ¶
func (a *AuthResult) RawIDToken() (string, error)
func (*AuthResult) Release ¶
func (a *AuthResult) Release()
type DiscoverAccountsResult ¶
type DiscoverAccountsResult struct {
// contains filtered or unexported fields
}
MSALRUNTIME_DISCOVER_ACCOUNTS_RESULT_HANDLE with its getters
func (*DiscoverAccountsResult) Accounts ¶
func (a *DiscoverAccountsResult) Accounts() []*Account
Accounts by index until the runtime answers the next index with an error or a null account
func (*DiscoverAccountsResult) Failure ¶
func (a *DiscoverAccountsResult) Failure() (*Error, error)
func (*DiscoverAccountsResult) Release ¶
func (a *DiscoverAccountsResult) Release()
type ReadAccountResult ¶
type ReadAccountResult struct {
// contains filtered or unexported fields
}
MSALRUNTIME_READ_ACCOUNT_RESULT_HANDLE with its getters
func (*ReadAccountResult) Account ¶
func (a *ReadAccountResult) Account() (*Account, error)
func (*ReadAccountResult) Failure ¶
func (a *ReadAccountResult) Failure() (*Error, error)
func (*ReadAccountResult) Release ¶
func (a *ReadAccountResult) Release()
type Runtime ¶
type Runtime struct {
Path string
// contains filtered or unexported fields
}
A started MSALRuntime with its log callback registered, shared by the whole process
func Load ¶
Loads the library at path, starts the runtime and registers the log callback, retried until a start succeeds
func (*Runtime) AcquireTokenInteractively ¶
func (r *Runtime) AcquireTokenInteractively(ctx context.Context, parent WindowHandle, params *AuthParameters, correlationID string, account *Account) (*AuthResult, error)
Acquires a token for a broker account through the broker UI
func (*Runtime) AcquireTokenSilently ¶
func (r *Runtime) AcquireTokenSilently(ctx context.Context, params *AuthParameters, correlationID string, account *Account) (*AuthResult, error)
Acquires a token for a broker account without UI
func (*Runtime) DiscoverAccounts ¶
func (r *Runtime) DiscoverAccounts(ctx context.Context, clientID, correlationID string) (*DiscoverAccountsResult, error)
Lists the broker accounts this client id can use
func (*Runtime) NewAuthParameters ¶
func (r *Runtime) NewAuthParameters(clientID, authority string) (*AuthParameters, error)
Creates auth parameters for a client id and an authority URL
func (*Runtime) ReadAccountByID ¶
func (r *Runtime) ReadAccountByID(ctx context.Context, accountID, correlationID string) (*ReadAccountResult, error)
Reads the broker account with this id
func (*Runtime) SetIsPIIEnabled ¶
Turns personal data in the runtime log on or off
func (*Runtime) Shutdown ¶
func (r *Runtime) Shutdown()
Releases the log callback and shuts the runtime down, the work pymsalruntime registers at exit
func (*Runtime) SignIn ¶
func (r *Runtime) SignIn(ctx context.Context, parent WindowHandle, params *AuthParameters, correlationID, accountHint string) (*AuthResult, error)
Signs in, silently when the broker can and interactively otherwise
func (*Runtime) SignInInteractively ¶
func (r *Runtime) SignInInteractively(ctx context.Context, parent WindowHandle, params *AuthParameters, correlationID, accountHint string) (*AuthResult, error)
Signs in through the broker UI parented on the window handle
func (*Runtime) SignInSilently ¶
func (r *Runtime) SignInSilently(ctx context.Context, params *AuthParameters, correlationID string) (*AuthResult, error)
Signs in the default broker account without UI
func (*Runtime) SignOutSilently ¶
func (r *Runtime) SignOutSilently(ctx context.Context, clientID, correlationID string, account *Account) (*SignOutResult, error)
Signs a broker account out of this client id
type SignOutResult ¶
type SignOutResult struct {
// contains filtered or unexported fields
}
MSALRUNTIME_SIGNOUT_RESULT_HANDLE with its getters
func (*SignOutResult) Failure ¶
func (a *SignOutResult) Failure() (*Error, error)
func (*SignOutResult) Release ¶
func (a *SignOutResult) Release()
type StartupError ¶
type StartupError struct{ Err *Error }
MSALRUNTIME_Startup failed, the condition msal answers by turning the broker off
func (*StartupError) Error ¶
func (e *StartupError) Error() string
type Status ¶
type Status int32
MSALRUNTIME_RESPONSE_STATUS of an error handle
const ( StatusUnexpected Status = iota StatusReserved StatusInteractionRequired StatusNoNetwork StatusApiContractViolation StatusUserCanceled StatusApplicationCanceled StatusIncorrectConfiguration StatusInsufficientBuffer StatusAuthorityUntrusted StatusUserSwitch StatusAccountUnusable StatusUserDataRemovalRequired StatusKeyNotFound StatusAccountNotFound StatusTransientError StatusAccountSwitch StatusRequiredBrokerMissing StatusDeviceNotRegistered StatusFallbackToNativeMsal )
type WindowHandle ¶
type WindowHandle uintptr
Window handle the interactive calls parent their UI on, HWND on Windows and int64 elsewhere
func ConsoleWindow ¶
func ConsoleWindow() WindowHandle
Console window handle, zero outside Windows where window handles are int64 values the caller supplies