public async Task <TokenRawResult> PostArbitraryResourceOwnerAsync() { _logger.LogInformation("Summary Executing..."); var extensionGrantRequest = new ArbitraryResourceOwnerRequest() { ClientId = "arbitrary-resource-owner-client", Scopes = new List <string>() { "offline_access", "metal", "nitro", "In", "Flames" }, Subject = "PorkyPig", ArbitraryClaims = new Dictionary <string, List <string> >() { { "top", new List <string>() { "dog" } }, { "role", new List <string>() { "application", "limited" } }, { "query", new List <string>() { "dashboard", "licensing" } }, { "seatId", new List <string>() { "2368d213-d06c-4c2a-a099-11c34adc357" } }, { "piid", new List <string>() { "2368d213-1111-4c2a-a099-11c34adc3579" } } }, AccessTokenLifetime = "3600", ArbitraryAmrs = new List <string>() { "agent:username:[email protected]", "agent:challenge:fullSSN", "agent:challenge:homeZip" }, ArbitraryAudiences = new List <string>() { "cat", "dog" }, CustomPayload = new CustomPayload() }; var result = await _tokenEndpointHandlerExtra.ProcessRawAsync(extensionGrantRequest); return(result); }
internal ArbitraryResourceOwnerRequest ToArbitraryResourceOwnerRequest(ResourceOwnerTokenRequest resourceOwnerTokenRequest) { Guard.ArgumentNotNull(nameof(resourceOwnerTokenRequest), resourceOwnerTokenRequest); var valid = !string.IsNullOrWhiteSpace(_clientId) || !string.IsNullOrWhiteSpace(resourceOwnerTokenRequest.ClientId); Guard.OperationValid(valid, "all clientId(s) are null!"); var scopesList = resourceOwnerTokenRequest.Scope.Split(' ').ToList(); var extensionGrantRequest = new ArbitraryResourceOwnerRequest() { ClientId = string.IsNullOrEmpty(resourceOwnerTokenRequest.ClientId) ? _clientId : resourceOwnerTokenRequest.ClientId, Scopes = scopesList, Subject = resourceOwnerTokenRequest.Subject, ArbitraryClaims = resourceOwnerTokenRequest.ArbitraryClaims, AccessTokenLifetime = resourceOwnerTokenRequest.AccessTokenLifetime.ToString() }; return(extensionGrantRequest); }