Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
small docs fixes, and other feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Feb 1, 2017
1 parent 36bd699 commit 6a67e20
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/IdentityServer4/Events/EventServiceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public bool CanRaiseEvent<T>(Event<T> evt)
return _options.Events.RaiseSuccessEvents;
case EventTypes.Error:
return _options.Events.RaiseErrorEvents;
default:
throw new ArgumentOutOfRangeException();
}

return false;
}

public virtual Event<T> PrepareEvent<T>(Event<T> evt)
Expand Down
9 changes: 4 additions & 5 deletions src/IdentityServer4/Extensions/ICacheExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ public static class ICacheExtensions
/// <param name="key">The key.</param>
/// <param name="duration">The duration.</param>
/// <param name="get">The get function.</param>
/// <param name="logger">The logger.</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException">
/// cache
/// or
/// get
/// </exception>
/// <exception cref="System.ArgumentNullException">cache
/// or
/// get</exception>
/// <exception cref="ArgumentNullException">cache
/// or
/// get</exception>
public static async Task<T> GetAsync<T>(this ICache<T> cache, string key, TimeSpan duration, Func<Task<T>> get, ILogger logger)
where T : class
{
Expand Down
3 changes: 2 additions & 1 deletion src/IdentityServer4/Models/Secret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ public override int GetHashCode()

public override bool Equals(object obj)
{
var other = obj as Secret;
if (obj == null) return false;
var other = obj as Secret;
if (other == null) return false;
if (Object.ReferenceEquals(other, this)) return true;

return String.Equals(other.Type, Type, StringComparison.Ordinal) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public async Task GrantConsentAsync(AuthorizationRequest request, ConsentRespons
subject = user?.GetSubjectId();
}

if (subject == null) throw new ArgumentNullException("User is not currently authenticated, and no subject id passed", nameof(subject));
if (subject == null) throw new ArgumentNullException(nameof(subject), "User is not currently authenticated, and no subject id passed");

var consentRequest = new ConsentRequest(request, subject);
await _consentMessageStore.WriteAsync(consentRequest.Id, new Message<ConsentResponse>(consent));
Expand Down
12 changes: 8 additions & 4 deletions src/IdentityServer4/Services/Interfaces/IClaimsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,24 @@ public interface IClaimsService
/// </summary>
/// <param name="subject">The subject</param>
/// <param name="client">The client</param>
/// <param name="scopes">The requested scopes</param>
/// <param name="resources">The resources.</param>
/// <param name="includeAllIdentityClaims">Specifies if all claims should be included in the token, or if the userinfo endpoint can be used to retrieve them</param>
/// <param name="request">The raw request</param>
/// <returns>Claims for the identity token</returns>
/// <returns>
/// Claims for the identity token
/// </returns>
Task<IEnumerable<Claim>> GetIdentityTokenClaimsAsync(ClaimsPrincipal subject, Client client, Resources resources, bool includeAllIdentityClaims, ValidatedRequest request);

/// <summary>
/// Returns claims for an access token.
/// </summary>
/// <param name="subject">The subject.</param>
/// <param name="client">The client.</param>
/// <param name="scopes">The requested scopes.</param>
/// <param name="resources">The resources.</param>
/// <param name="request">The raw request.</param>
/// <returns>Claims for the access token</returns>
/// <returns>
/// Claims for the access token
/// </returns>
Task<IEnumerable<Claim>> GetAccessTokenClaimsAsync(ClaimsPrincipal subject, Client client, Resources resources, ValidatedRequest request);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public DefaultReferenceTokenStore(
/// <summary>
/// Stores the reference token asynchronous.
/// </summary>
/// <param name="handle">The handle.</param>
/// <param name="token">The token.</param>
/// <returns></returns>
public Task<string> StoreReferenceTokenAsync(Token token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ public GrantValidationResult(TokenRequestErrors error, string errorDescription =
}

/// <summary>
/// Initializes a new instance of the <see cref="GrantValidationResult"/> class.
/// Initializes a new instance of the <see cref="GrantValidationResult" /> class.
/// </summary>
/// <param name="subject">The subject claim used to uniquely identifier the user.</param>
/// <param name="authenticationMethod">The authentication method which describes the custom grant type.</param>
/// <param name="claims">Additional claims that will be maintained in the principal.</param>
/// <param name="identityProvider">The identity provider.</param>
/// <param name="customResponse">The custom response.</param>
public GrantValidationResult(
string subject,
string authenticationMethod,
Expand Down
3 changes: 2 additions & 1 deletion src/IdentityServer4/Validation/ScopeValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using IdentityServer4.Models;
using IdentityServer4.Stores;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -49,7 +50,7 @@ public void SetConsentedScopes(IEnumerable<string> consentedScopes)
var offline = consentedScopes.Contains(IdentityServerConstants.StandardScopes.OfflineAccess);
if (offline)
{
consentedScopes.Where(x => x != IdentityServerConstants.StandardScopes.OfflineAccess);
consentedScopes = consentedScopes.Where(x => x != IdentityServerConstants.StandardScopes.OfflineAccess);
}

var identityToKeep = GrantedResources.IdentityResources.Where(x => x.Required || consentedScopes.Contains(x.Name));
Expand Down

0 comments on commit 6a67e20

Please sign in to comment.