Class GrantValidationResult
- Namespace
- Duende.IdentityServer.Validation
- Assembly
- Duende.IdentityServer.dll
Models the result of custom grant validation.
public class GrantValidationResult : ValidationResult- Inheritance
- 
      
      
      GrantValidationResult
- Inherited Members
Constructors
GrantValidationResult(TokenRequestErrors, string, Dictionary<string, object>)
Initializes a new instance of the GrantValidationResult class with an error and description.
public GrantValidationResult(TokenRequestErrors error, string errorDescription = null, Dictionary<string, object> customResponse = null)Parameters
- errorTokenRequestErrors
- The error. 
- errorDescriptionstring
- The error description. 
- customResponseDictionary<string, object>
- Custom response elements 
GrantValidationResult(Dictionary<string, object>)
Initializes a new instance of the GrantValidationResult class with no subject. Warning: the resulting access token will only contain the client identity.
public GrantValidationResult(Dictionary<string, object> customResponse = null)Parameters
- customResponseDictionary<string, object>
GrantValidationResult(ClaimsPrincipal, Dictionary<string, object>)
Initializes a new instance of the GrantValidationResult class with a given principal. Warning: the principal needs to include the required claims - it is recommended to use the other constructor that does validation.
public GrantValidationResult(ClaimsPrincipal principal, Dictionary<string, object> customResponse = null)Parameters
- principalClaimsPrincipal
- customResponseDictionary<string, object>
GrantValidationResult(string, string, IEnumerable<Claim>, string, Dictionary<string, object>)
Initializes a new instance of the GrantValidationResult class.
public GrantValidationResult(string subject, string authenticationMethod, IEnumerable<Claim> claims = null, string identityProvider = "local", Dictionary<string, object> customResponse = null)Parameters
- subjectstring
- The subject claim used to uniquely identifier the user. 
- authenticationMethodstring
- The authentication method which describes the custom grant type. 
- claimsIEnumerable<Claim>
- Additional claims that will be maintained in the principal. If you want these claims to appear in token, you need to add them explicitly in your custom implementation of IProfileService service. 
- identityProviderstring
- The identity provider. 
- customResponseDictionary<string, object>
- The custom response. 
GrantValidationResult(string, string, DateTime, IEnumerable<Claim>, string, Dictionary<string, object>)
Initializes a new instance of the GrantValidationResult class.
public GrantValidationResult(string subject, string authenticationMethod, DateTime authTime, IEnumerable<Claim> claims = null, string identityProvider = "local", Dictionary<string, object> customResponse = null)Parameters
- subjectstring
- The subject claim used to uniquely identifier the user. 
- authenticationMethodstring
- The authentication method which describes the custom grant type. 
- authTimeDateTime
- The UTC date/time of authentication. 
- claimsIEnumerable<Claim>
- Additional claims that will be maintained in the principal. If you want these claims to appear in token, you need to add them explicitly in your custom implementation of IProfileService service. 
- identityProviderstring
- The identity provider. 
- customResponseDictionary<string, object>
- The custom response. 
Properties
CustomResponse
Custom fields for the token response
public Dictionary<string, object> CustomResponse { get; set; }Property Value
Subject
Gets or sets the principal which represents the result of the validation.
public ClaimsPrincipal Subject { get; set; }Property Value
- ClaimsPrincipal
- The principal.