Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add WordPressClaimTypes
  • Loading branch information
khellang committed Feb 15, 2018
commit 2d349adc14dd8608cd58412344d3ae4ac96d53af
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public WordPressAuthenticationOptions()

ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "ID");
ClaimActions.MapJsonKey(ClaimTypes.Name, "username");
ClaimActions.MapJsonKey("urn:wordpress:email", "email");
ClaimActions.MapJsonKey("urn:wordpress:displayname", "display_name");
ClaimActions.MapJsonKey("urn:wordpress:profileurl", "profile_URL");
ClaimActions.MapJsonKey("urn:wordpress:avatarurl", "avatar_URL");
ClaimActions.MapJsonKey("urn:wordpress:primaryblog", "primary_blog");
ClaimActions.MapJsonKey(WordPressClaimTypes.Email, "email");
ClaimActions.MapJsonKey(WordPressClaimTypes.DisplayName, "display_name");
ClaimActions.MapJsonKey(WordPressClaimTypes.ProfileUrl, "profile_URL");
ClaimActions.MapJsonKey(WordPressClaimTypes.AvatarUrl, "avatar_URL");
ClaimActions.MapJsonKey(WordPressClaimTypes.PrimaryBlog, "primary_blog");
}
}
}
24 changes: 24 additions & 0 deletions src/AspNet.Security.OAuth.WordPress/WordPressClaimTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers
* for more information concerning the license and the contributors participating to this project.
*/

namespace AspNet.Security.OAuth.WordPress
{
/// <summary>
/// Contains claim types specific to the <see cref="WordPressAuthenticationHandler"/>.
/// </summary>
public static class WordPressClaimTypes
{
public const string Email = "urn:wordpress:email";

public const string DisplayName = "urn:wordpress:displayname";

public const string ProfileUrl = "urn:wordpress:profileurl";

public const string AvatarUrl = "urn:wordpress:avatarurl";

public const string PrimaryBlog = "urn:wordpress:primaryblog";
}
}