Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 766a91e

Browse files
Added authentication methdos and cleanup
1 parent 9c184ae commit 766a91e

7 files changed

Lines changed: 73 additions & 39 deletions

File tree

source/IdentityModel.Shared/Base64Url.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ public static byte[] Decode(string arg)
4848
return Convert.FromBase64String(s); // Standard base64 decoder
4949
}
5050
}
51-
}
51+
}

source/IdentityModel.Shared/Constants/Algorithms.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ public static class Algorithms
2626
public const string Sha384Digest = "http://www.w3.org/2001/04/xmlenc#sha384";
2727
public const string Sha512Digest = "http://www.w3.org/2001/04/xmlenc#sha512";
2828
}
29-
}
29+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2014, 2015 Dominick Baier, Brock Allen
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
namespace IdentityModel.Constants
18+
{
19+
public static class AuthenticationMethods
20+
{
21+
public const string Password = "pwd";
22+
public const string ProofOfPossion = "pop";
23+
public const string OneTimePassword = "otp";
24+
public const string FingerprintBiometric = "fpt";
25+
public const string RetinaScanBiometric = "eye";
26+
public const string VoiceBiometric = "vbm";
27+
public const string ConfirmationByTelephone = "tel";
28+
public const string ConfirmationBySms = "sms";
29+
public const string KnowledgeBasedAuthentication = "kba";
30+
public const string WindowsIntegratedAuthentication = "wia";
31+
public const string MultiFactorAuthentication = "mfa";
32+
}
33+
}

source/IdentityModel.Shared/Constants/TokenTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public static class TokenTypes
2929
public const string SimpleWebToken = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0";
3030
public const string JsonWebToken = "urn:ietf:params:oauth:token-type:jwt";
3131
}
32-
}
32+
}

source/IdentityModel.Shared/EpochTimeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ public static DateTimeOffset ToDateTimeOffsetFromEpoch(this long intDate)
6060
return new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero).AddTicks(timeInTicks);
6161
}
6262
}
63-
}
63+
}

source/IdentityModel.Shared/IdentityModel.Shared.projitems

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<Compile Include="$(MSBuildThisFileDirectory)Client\UserInfoClient.cs" />
2424
<Compile Include="$(MSBuildThisFileDirectory)Client\UserInfoResponse.cs" />
2525
<Compile Include="$(MSBuildThisFileDirectory)Constants\Algorithms.cs" />
26+
<Compile Include="$(MSBuildThisFileDirectory)Constants\AuthenticationMethods.cs" />
2627
<Compile Include="$(MSBuildThisFileDirectory)Constants\SamlNameIdentifierFormats.cs" />
2728
<Compile Include="$(MSBuildThisFileDirectory)Constants\TokenTypes.cs" />
2829
<Compile Include="$(MSBuildThisFileDirectory)EpochTimeExtensions.cs" />

source/IdentityModel.Shared/JwtClaimTypes.cs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,47 @@ namespace IdentityModel
1919
public static class JwtClaimTypes
2020
{
2121
// core oidc claims
22-
public const string Subject = "sub";
23-
public const string Name = "name";
24-
public const string GivenName = "given_name";
25-
public const string FamilyName = "family_name";
26-
public const string MiddleName = "middle_name";
27-
public const string NickName = "nickname";
28-
public const string PreferredUserName = "preferred_username";
29-
public const string Profile = "profile";
30-
public const string Picture = "picture";
31-
public const string WebSite = "website";
32-
public const string Email = "email";
33-
public const string EmailVerified = "email_verified";
34-
public const string Gender = "gender";
35-
public const string BirthDate = "birthdate";
36-
public const string ZoneInfo = "zoneinfo";
37-
public const string Locale = "locale";
38-
public const string PhoneNumber = "phone_number";
22+
public const string Subject = "sub";
23+
public const string Name = "name";
24+
public const string GivenName = "given_name";
25+
public const string FamilyName = "family_name";
26+
public const string MiddleName = "middle_name";
27+
public const string NickName = "nickname";
28+
public const string PreferredUserName = "preferred_username";
29+
public const string Profile = "profile";
30+
public const string Picture = "picture";
31+
public const string WebSite = "website";
32+
public const string Email = "email";
33+
public const string EmailVerified = "email_verified";
34+
public const string Gender = "gender";
35+
public const string BirthDate = "birthdate";
36+
public const string ZoneInfo = "zoneinfo";
37+
public const string Locale = "locale";
38+
public const string PhoneNumber = "phone_number";
3939
public const string PhoneNumberVerified = "phone_number_verified";
40-
public const string Address = "address";
41-
public const string Audience = "aud";
42-
public const string Issuer = "iss";
43-
public const string NotBefore = "nbf";
44-
public const string Expiration = "exp";
40+
public const string Address = "address";
41+
public const string Audience = "aud";
42+
public const string Issuer = "iss";
43+
public const string NotBefore = "nbf";
44+
public const string Expiration = "exp";
4545

4646
// more standard claims
47-
public const string UpdatedAt = "updated_at";
48-
public const string IssuedAt = "iat";
49-
public const string AuthenticationMethod = "amr";
47+
public const string UpdatedAt = "updated_at";
48+
public const string IssuedAt = "iat";
49+
public const string AuthenticationMethod = "amr";
5050
public const string AuthenticationContextClassReference = "acr";
51-
public const string AuthenticationTime = "auth_time";
52-
public const string AuthorizedParty = "azp";
53-
public const string AccessTokenHash = "at_hash";
54-
public const string AuthorizationCodeHash = "c_hash";
55-
public const string Nonce = "nonce";
51+
public const string AuthenticationTime = "auth_time";
52+
public const string AuthorizedParty = "azp";
53+
public const string AccessTokenHash = "at_hash";
54+
public const string AuthorizationCodeHash = "c_hash";
55+
public const string Nonce = "nonce";
5656

5757
// more claims
58-
public const string ClientId = "client_id";
59-
public const string Scope = "scope";
60-
public const string Id = "id";
61-
public const string Secret = "secret";
58+
public const string ClientId = "client_id";
59+
public const string Scope = "scope";
60+
public const string Id = "id";
61+
public const string Secret = "secret";
6262
public const string IdentityProvider = "idp";
63-
public const string Role = "role";
63+
public const string Role = "role";
6464
}
6565
}

0 commit comments

Comments
 (0)