You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
In IdentityServer 1.1 you add #694 but when I use pure OAuth 2.0 Resource Owner Credentials Flow there is no option to disable id_token generation on response. My configuration looks like this.
public static class Constants
{
public const string ApiV1Scope = "api_v1";
public const string FrontEndClientId = "front-end";
}
public class SystemClaims
{
public const string UserIdClaim = "sub";
public const string NameClaim = "name";
public const string EmailClaim = "email";
public static string[] AllClaims = {
UserIdClaim,
NameClaim,
EmailClaim
};
}
public class IdentityServerConfiguration
{
internal static IEnumerable<ApiResource> GetApiResources(string apiSecret)
{
if (string.IsNullOrEmpty(apiSecret))
throw new ArgumentNullException(nameof(apiSecret));
var result = new[]
{
new ApiResource(Constants.ApiV1Scope, "HTTP API")
{
ApiSecrets = {new Secret(apiSecret.Sha256())},
UserClaims = SystemClaims.AllClaims
}
};
return result;
}
internal static IEnumerable<Client> GetClients(string[] frontEndLocations)
{
if (frontEndLocations?.Length == 0)
throw new ArgumentNullException(nameof(frontEndLocations));
return new[]
{
new Client
{
ClientId = Constants.FrontEndClientId,
AllowedScopes = {Constants.ApiV1Scope},
RequireClientSecret = false,
AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
AllowOfflineAccess = true,
AllowAccessTokensViaBrowser = true,
UpdateAccessTokenClaimsOnRefresh = true,
AllowedCorsOrigins = frontEndLocations,
RefreshTokenUsage = TokenUsage.OneTimeOnly,
AccessTokenType = AccessTokenType.Jwt
}
};
}
}
My access_token request looks like this.
POST /connect/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=password&username=test&password=test&client_id=front-end
But I don't ask Idsrv4 for id_token in my config! I think Idsrv4 it should check scopes for openid and return id_token only if it was required with identity scope.
P.S. - sorry for my English.
The text was updated successfully, but these errors were encountered:
leastprivilege
changed the title
How to disable id_token generation on response when refresh token.
Refresh requests should not return identity tokens if no identity scopes were requested
Feb 15, 2017
In IdentityServer 1.1 you add #694 but when I use pure OAuth 2.0 Resource Owner Credentials Flow there is no option to disable id_token generation on response. My configuration looks like this.
My access_token request looks like this.
It return a correct answer like this
But when I refresh my token with
It will return something like this
But I don't ask Idsrv4 for id_token in my config! I think Idsrv4 it should check scopes for openid and return id_token only if it was required with identity scope.
P.S. - sorry for my English.
The text was updated successfully, but these errors were encountered: