zettelkasten/OneNoteExport/Kommunikationstechnologie/Sharepoint/Infrastruktur/106_Claims des Benutzers anzeigen lassen _.md
Ralf Koop 5a108aa2b4 .
2023-08-25 23:29:11 +02:00

5.1 KiB

 

Dienstag, 10. April 2018

09:54

 

Claims des Benutzers anzeigen lassen :

 

Hierfür benötigt man eine ASPX-Datei mit folgendem Inhalt, die im _layouts Ordner vom SharePoint abgespeichert wird:

 

<%@ Page Language="C#" %>

<%@ Assembly Name="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" %>

<%@ Import Namespace="Microsoft.IdentityModel.Claims" %>

<script type="text/C#" runat="server">

protected override void OnLoad(EventArgs e)

{

try

{

IClaimsIdentity identity = HttpContext.Current.User.Identity as IClaimsIdentity;

if (null != identity)

{

repeater1.DataSource = identity.Claims;

repeater1.DataBind();

}

}

catch (Exception ex)

{

Response.Write(ex.ToString());

}

}

</script>

<html>

<body>

<table>

<thead>

<tr>

<td><strong>Issuer</strong></td>

<td><strong>OriginalIssuer</strong></td>

<td><strong>ClaimType</strong></td>

<td><strong>Subject</strong></td>

<td><strong>Value</strong></td>

<td><strong>ValueType</strong></td>

</tr>

</thead>

<tbody>

<asp:Repeater ID="repeater1" runat="server">

<ItemTemplate>

<tr>

<td><nobr><%# Eval("Issuer") %></nobr></td>

<td><nobr><%# Eval("OriginalIssuer") %></nobr></td>

<td><nobr><%# Eval("ClaimType") %></nobr></td>

<td><nobr><%# Eval("Subject") %></nobr></td>

<td><nobr><%# Eval("Value") %></nobr></td>

<td><nobr><%# Eval("ValueType") %></nobr></td>

</tr>

</ItemTemplate>

</asp:Repeater>

</tbody>

</table>

</body>

</html>

 

 

**Format **

SharePoint 2013 and SharePoint 2010 display identity claims with the following encoding format:

<IdentityClaim>:0<ClaimType><ClaimValueType><AuthMode>|<OriginalIssuer (optional)>|<ClaimValue>

Components explained

<IdentityClaim>

  • <IdentityClaim> indicates the type of claim and is the following:

    • "i" for an identity claim

    • "c" for any other claim

<ClaimType>

  • <ClaimType> indicates the format for the claim value and is the following:

    • "#" for a user logon name

    • "." for  an anonymous user

    • "5" for an email address

    • "!" for an identity provider

    • "+" for a Group security identifier (SID)

    • "-" for a role

    • "%" for a farm ID

    • "?" for a name identifier

    • "\" for a private personal identifier (PPID)

    • "e" for a user principal name (UPN)

    • """ for a user ID

    • "$" for a distribution list security identifier (SID)

    • "&" for a process identity security identifier (SID)

    • "'" for a process identity logon name

    • "(" for an authenticated user

    • ")" for a primary security identifier (SID)

    • "*" for a primary group security identifier (SID)

    • "0" for an authorization decision

    • "1" for a country

    • "2" for a date of birth

    • "3" for a deny only security identifier (SID)

    • "4" for DNS

    • "6" for a gender

    • "7" for a given name

    • "8" for a hash

    • "9" for a home phone

    • "<" for a locality

    • "=" for a mobile phone

    • ">" for a name

    • "@" for other phone

    • "[" for a postal code

    • "]" for RSA

    • "^" for a secure identifier (SID)

    • "_" for a service principal name (SPN)

    • "`" for a state or province

    • "a" for a street address

    • "b" for a surname

    • "c" for a system

    • "d" for a thumbprint

    • "f" for a uniform resource name (URI)

    • "g" for a web page

<ClaimValueType>

  • <ClaimValueType> indicates the type of formatting for the claim value and is the following:

    • "." for a string

    • "+" for an RFC 822-formatted name

    • ")"  for an integer

    • """ for a Boolean

    • "#" for a date

    • "$" for a date with time

    • "&" for a double

    • "!" for a Base64 formatted binary

    • "0" for a X.500 formatted name

<AuthMode>

  • <AuthMode> indicates the type of authentication used to obtain the identity claim and is the following:

    • "w" for Windows claims (no original issuer)

    • "s" for the local SharePoint security token service (STS) (no original issuer)

    • "t" for a trusted issuer

    • "m" for a membership issuer

    • "r" for a role provider issuer

    • "f" for forms-based authentication

    • "c" for a claim provider

<OriginalIssuer>

  • <OriginalIssuer> indicates the original issuer of the claim.

<ClaimValueType>

  • <ClaimValueType> indicates the value of the claim in the <ClaimType> format.

 

Aus <https://social.technet.microsoft.com/wiki/contents/articles/13921.sharepoint-20102013-claims-encoding.aspx>