Class AcquireTokenByUsernamePasswordParameterBuilder
Parameter builder for the AcquireTokenByUsernamePassword(IEnumerable<string>, string, string) operation. See https://aka.ms/msal-net-up
public sealed class AcquireTokenByUsernamePasswordParameterBuilder : AbstractPublicClientAcquireTokenParameterBuilder<AcquireTokenByUsernamePasswordParameterBuilder>
- Inheritance
-
AcquireTokenByUsernamePasswordParameterBuilder
- Inherited Members
- Extension Methods
Methods
WithFederationMetadata(string)
Enables MSAL to read the federation metadata for a WS-Trust exchange from the provided input instead of acquiring it from an endpoint. This is only applicable for managed ADFS accounts. See https://aka.ms/MsalFederationMetadata.
public AcquireTokenByUsernamePasswordParameterBuilder WithFederationMetadata(string federationMetadata)
Parameters
federationMetadata
stringFederation metadata in the form of XML.
Returns
- AcquireTokenByUsernamePasswordParameterBuilder
The builder to chain the .With methods
WithProofOfPossession(string, HttpMethod, Uri)
Modifies the token acquisition request so that the acquired token is a Proof-of-Possession token (PoP), rather than a Bearer token. PoP tokens are similar to Bearer tokens, but are bound to the HTTP request and to a cryptographic key, which MSAL can manage on Windows. Note that only the host and path parts of the request URI will be bound. See https://aka.ms/msal-net-pop
public AcquireTokenByUsernamePasswordParameterBuilder WithProofOfPossession(string nonce, HttpMethod httpMethod, Uri requestUri)
Parameters
nonce
stringNonce of the protected resource (RP) which will be published as part of the WWWAuthenticate header associated with a 401 HTTP response or as part of the AuthorityInfo header associated with 200 response. Set it here to make it part of the Signed HTTP Request part of the POP token.
httpMethod
HttpMethodThe HTTP method ("GET", "POST" etc.) method that will be bound to the token. If set to null, the PoP token will not be bound to the method. Corresponds to the "m" part of the a signed HTTP request.
requestUri
UriThe URI to bind the signed HTTP request to.
Returns
- AcquireTokenByUsernamePasswordParameterBuilder
The builder.
Remarks
- An Authentication header is automatically added to the request.
- The PoP token is bound to the HTTP request, more specifically to the HTTP method (GET, POST, etc.) and to the Uri (path and query, but not query parameters).
- Broker is required to use Proof-of-Possession on public clients.