package ops

import "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops"

Package ops provides operations to various backend services using REST clients.

The REST type provides several clients that can be used to communicate to backends. Usage is simple:

rest := ops.New()

// Creates an authority client and calls the UserRealm() method.
userRealm, err := rest.Authority().UserRealm(ctx, authParameters)
if err != nil {
	// Do something
}

Index

Types

type HTTPClient

type HTTPClient = comm.HTTPClient

HTTPClient represents an HTTP client. It's usually an *http.Client from the standard library.

type REST

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

REST provides REST clients for communicating with various backends used by MSAL.

func New

func New(httpClient HTTPClient) *REST

New is the constructor for REST.

func (*REST) AccessTokens

func (r *REST) AccessTokens() accesstokens.Client

AccessTokens returns a client that can be used to get various access tokens for authorization purposes.

func (*REST) Authority

func (r *REST) Authority() authority.Client

Authority returns a client for querying information about various authorities.

func (*REST) WSTrust

func (r *REST) WSTrust() wstrust.Client

WSTrust provides access to various metadata in a WSTrust service. This data can be used to gain tokens based on SAML data using the client provided by AccessTokens().

Source Files

ops.go

Directories

PathSynopsis
apps/internal/oauth/ops/accesstokensPackage accesstokens exposes a REST client for querying backend systems to get various types of access tokens (oauth) for use in authentication.
apps/internal/oauth/ops/authority
apps/internal/oauth/ops/internal
apps/internal/oauth/ops/internal/commPackage comm provides helpers for communicating with HTTP backends.
apps/internal/oauth/ops/internal/grantPackage grant holds types of grants issued by authorization services.
apps/internal/oauth/ops/wstrustPackage wstrust provides a client for communicating with a WSTrust (https://en.wikipedia.org/wiki/WS-Trust#:~:text=WS%2DTrust%20is%20a%20WS,in%20a%20secure%20message%20exchange.) for the purposes of extracting metadata from the service.
apps/internal/oauth/ops/wstrust/defs
Version
v1.4.2 (latest)
Published
Mar 26, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
2 days ago

Tools for package owners.