Browse Source

Merge pull request #11171 from abpframework/auto-merge/rel-5-0/761

Merge branch dev with rel-5.0
pull/11177/head
maliming 5 years ago
committed by GitHub
parent
commit
0be4364bac
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      docs/en/Authorization.md

11
docs/en/Authorization.md

@ -428,7 +428,7 @@ This is already done for the startup template integration tests.
Claims are important elements of authentication and authorization. ABP uses the `IAbpClaimsPrincipalFactory` service to create claims on authentication. This service was designed as extensible. If you need to add your custom claims to the authentication ticket, you can implement the `IAbpClaimsPrincipalContributor` in your application.
**Example: Add a `SocialSecurityNumber` claim:**
**Example: Add a `SocialSecurityNumber` claim and get it:**
```csharp
public class SocialSecurityNumberClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency
@ -448,6 +448,15 @@ public class SocialSecurityNumberClaimsPrincipalContributor : IAbpClaimsPrincipa
}
}
}
public static class CurrentUserExtensions
{
public static string GetSocialSecurityNumber(ICurrentUser currentUser)
{
return currentUser.FindClaimValue("SocialSecurityNumber");
}
}
```
## See Also

Loading…
Cancel
Save