Created
April 10, 2014 22:57
-
-
Save shinkathe/10430367 to your computer and use it in GitHub Desktop.
CustomTokenService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomTokenService : SecurityTokenService | |
{ | |
public CustomTokenService(SecurityTokenServiceConfiguration config) : base(config) | |
{ | |
} | |
protected override ClaimsIdentity GetOutputClaimsIdentity(ClaimsPrincipal principal, System.IdentityModel.Protocols.WSTrust.RequestSecurityToken request, Scope scope) | |
{ | |
return principal.Identity as ClaimsIdentity; | |
} | |
protected override Scope GetScope(ClaimsPrincipal principal, System.IdentityModel.Protocols.WSTrust.RequestSecurityToken request) | |
{ | |
var s = new Scope(); | |
s.SigningCredentials = SecurityTokenServiceConfiguration.SigningCredentials; | |
s.TokenEncryptionRequired = false; | |
s.SymmetricKeyEncryptionRequired = false; | |
s.ReplyToAddress = request.ReplyTo; | |
s.AppliesToAddress = request.AppliesTo.Uri.ToString(); | |
return s; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment