Class TestIdentityBuilder
- Namespace
- XBullet.EasyTesting.Authentication
- Assembly
- XBullet.EasyTesting.dll
Fluently constructs an additional identity for a simulated principal.
public sealed class TestIdentityBuilder
- Inheritance
-
TestIdentityBuilder
- Inherited Members
Remarks
This mutable builder is not thread-safe. Each call to Build() returns a snapshot.
Methods
Build()
Creates the immutable identity definition.
public TestIdentity Build()
Returns
- TestIdentity
A new identity containing a snapshot of the current claim-type settings and claims.
WithAuthenticationType(string)
Sets the identity authentication type.
public TestIdentityBuilder WithAuthenticationType(string authenticationType)
Parameters
authenticationTypestringThe non-empty authentication type exposed by the identity.
Returns
- TestIdentityBuilder
This builder so additional identity values can be configured.
WithClaim(string, string)
Adds a claim to this identity.
public TestIdentityBuilder WithClaim(string type, string value)
Parameters
typestringThe non-empty claim-type identifier.
valuestringThe non-null claim value; an empty value is accepted.
Returns
- TestIdentityBuilder
This builder so additional identity values can be configured.
WithClaimTypes(string, string)
Sets the claim types used for name and role resolution.
public TestIdentityBuilder WithClaimTypes(string nameClaimType, string roleClaimType)
Parameters
nameClaimTypestringThe non-empty claim type resolved through Name.
roleClaimTypestringThe non-empty claim type used by role checks.
Returns
- TestIdentityBuilder
This builder so additional identity values can be configured.