oauthmicrosoft

package module
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package oauthmicrosoft provides a Microsoft OAuth provider for the Limen OAuth plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...ConfigOption) oauth.Provider

New creates a Microsoft OAuth provider that implements oauth.Provider.

Types

type ConfigOption

type ConfigOption func(*config)

ConfigOption configures the Microsoft OAuth plugin.

func WithAuthorityURL

func WithAuthorityURL(url string) ConfigOption

WithAuthorityURL sets a custom authority base URL for the authorization and token endpoints. Use this for Microsoft Entra External ID (CIAM) or other non-standard deployments.

Example CIAM: "https://mytenant.ciamlogin.com/mytenant.onmicrosoft.com" Example standard: "https://login.microsoftonline.com/contoso.onmicrosoft.com"

When set, this takes precedence over WithTenant.

func WithClientID

func WithClientID(id string) ConfigOption

WithClientID sets the Microsoft OAuth2 client ID (Application ID). Defaults to env var MICROSOFT_CLIENT_ID.

func WithClientSecret

func WithClientSecret(secret string) ConfigOption

WithClientSecret sets the Microsoft OAuth2 client secret. Defaults to env var MICROSOFT_CLIENT_SECRET.

func WithIDTokenVerifier

func WithIDTokenVerifier(verifier oauth.IDTokenVerifier) ConfigOption

func WithOption

func WithOption(key, value string) ConfigOption

WithOption sets any additional OAuth2 authorization parameters.

func WithRedirectURL

func WithRedirectURL(url string) ConfigOption

WithRedirectURL sets the callback URL registered in the Azure Portal.

func WithScopes

func WithScopes(scopes ...string) ConfigOption

WithScopes sets the OAuth2 scopes (e.g. "openid", "profile", "email").

func WithTenant

func WithTenant(tenant string) ConfigOption

WithTenant sets the Azure AD tenant for the authorization and token endpoints. Common values: "common" (default, all account types), "organizations" (work/school only), "consumers" (personal Microsoft accounts only), or a specific tenant GUID/domain.

Jump to

Keyboard shortcuts

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