msalruntime

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Version = "0.20.7"

Version of the msalruntime release whose native library this binding drives

Variables

This section is empty.

Functions

func Ensure

func Ensure(ctx context.Context, home string) (string, error)

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

func LibraryName() (string, bool)

Native library file Microsoft publishes for this OS and architecture, false where none is published

func LibraryPath

func LibraryPath(home string) (string, bool)

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) AccountID

func (a *Account) AccountID() (string, error)

func (*Account) AdditionalFieldsJSON

func (a *Account) AdditionalFieldsJSON() (string, error)

func (*Account) ClientInfo

func (a *Account) ClientInfo() (string, error)

func (*Account) DisplayName

func (a *Account) DisplayName() (string, error)

func (*Account) Environment

func (a *Account) Environment() (string, error)

func (*Account) FamilyName

func (a *Account) FamilyName() (string, error)

func (*Account) GivenName

func (a *Account) GivenName() (string, error)

func (*Account) HomeAccountID

func (a *Account) HomeAccountID() (string, error)

func (*Account) HomeEnvironment

func (a *Account) HomeEnvironment() (string, error)

func (*Account) LocalAccountID

func (a *Account) LocalAccountID() (string, error)

func (*Account) MiddleName

func (a *Account) MiddleName() (string, error)

func (*Account) Realm

func (a *Account) Realm() (string, error)

func (*Account) Release

func (a *Account) Release()

Releases the account handle

func (*Account) UserName

func (a *Account) UserName() (string, error)

type AuthParameters

type AuthParameters struct {
	// contains filtered or unexported fields
}

MSALRUNTIME_AUTH_PARAMETERS_HANDLE with its setters

func (*AuthParameters) Release

func (p *AuthParameters) Release()

Releases the parameters handle

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()

func (*AuthResult) Telemetry

func (a *AuthResult) Telemetry() (map[string]string, error)

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()

func (*DiscoverAccountsResult) Telemetry

func (a *DiscoverAccountsResult) Telemetry() (map[string]string, error)

type Error

type Error struct {
	Status  Status
	Code    int64
	Tag     int32
	Context string
}

Contents of an MSALRUNTIME_ERROR_HANDLE read before the handle is released

func (*Error) Error

func (e *Error) Error() string

type LoadError

type LoadError struct {
	Path   string
	Detail string
}

Library cannot be loaded on this machine, naming the file and the reason

func (*LoadError) Error

func (e *LoadError) Error() string

type LogLevel

type LogLevel int32

MSALRUNTIME_LOG_LEVEL of a log callback entry

const (
	LogTrace LogLevel = iota + 1
	LogDebug
	LogInfo
	LogWarning
	LogError
	LogFatal
)

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()

func (*ReadAccountResult) Telemetry

func (a *ReadAccountResult) Telemetry() (map[string]string, error)

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

func Load(path string) (*Runtime, error)

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

func (r *Runtime) SetIsPIIEnabled(enabled bool)

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()

func (*SignOutResult) Telemetry

func (a *SignOutResult) Telemetry() (map[string]string, error)

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
	StatusNetworkTemporarilyUnavailable
	StatusServerTemporarilyUnavailable
	StatusApiContractViolation
	StatusUserCanceled
	StatusApplicationCanceled
	StatusIncorrectConfiguration
	StatusInsufficientBuffer
	StatusAuthorityUntrusted
	StatusUserSwitch
	StatusAccountUnusable
	StatusUserDataRemovalRequired
	StatusKeyNotFound
	StatusAccountNotFound
	StatusTransientError
	StatusAccountSwitch
	StatusRequiredBrokerMissing
	StatusDeviceNotRegistered
	StatusFallbackToNativeMsal
)

func (Status) String

func (s Status) String() string

Python enum text pymsalruntime formats, Response_Status.Status_Name or the bare number outside the enum

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

func DesktopWindow

func DesktopWindow() WindowHandle

Desktop window handle, zero outside Windows

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL