Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Authentication.dll Namespace: Microsoft.OData.Mcp.Authentication.Outbound Inheritance: System.Object

Syntax

Summary

Supplies the enterprise OpenID Connect id token the identity assertion grant exchanges, reading it from the file --idp-id-token-file names or from the ODataMcpAuthConstants.IdTokenEnvironmentVariable environment variable.

Remarks

Per specs/v3/AUTHENTICATION.md “Grants → Identity Assertion Grant” the id token is never passed on argv: a process list is world-readable on every platform this tool ships to, and an id token is a bearer credential for the end user’s enterprise identity. The file is re-read on every call rather than cached, so a daemon whose sidecar rotates the token picks the new one up without a restart, and per AUTH-12 nothing here ever logs, elicits, or echoes the token itself — only the path it came from.

Examples

Constructors

.ctor

Initializes a new instance of the FileIdTokenCallback class.

Syntax

Parameters

Remarks

A null path is not an error: the environment variable is the other documented source, and which of the two an operator configured is only knowable when the token is actually needed.

.ctor Inherited

Inherited from object

Syntax

Properties

Path

Gets the path of the file the id token is read from, or null when only the environment variable is consulted.

Syntax

Property Value

Type: string?

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReadAsync

Reads the id token, preferring the configured file over the environment variable.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<string> The trimmed id token.

Exceptions

Examples

Remarks

The token is trimmed because both sources routinely pick up a trailing newline — a shell redirection, a Kubernetes projected volume — and a JWT with a newline on the end is rejected by every token endpoint with an error that says nothing about whitespace. Failures name the source, never the value.

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?