-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional JWT Security Token Support
Fix line endings. Add test for JavaScriptSerializer.Deserialize(string input, Type targetType).
- Loading branch information
1 parent
643ad91
commit 950d9c8
Showing
10 changed files
with
268 additions
and
19 deletions.
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenExpiredException.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// SecurityTokenExpiredException.cs | ||
// | ||
// Author: | ||
// Noesis Labs (Ryan.Melena@noesislabs.com) | ||
// | ||
// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
#if NET_4_5 | ||
|
||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace System.IdentityModel.Tokens | ||
{ | ||
public class SecurityTokenExpiredException : SecurityTokenValidationException | ||
{ | ||
public SecurityTokenExpiredException() | ||
: base("ID4181: The security token has expired.") | ||
{ } | ||
|
||
public SecurityTokenExpiredException(string message) | ||
: base(message) | ||
{ } | ||
|
||
public SecurityTokenExpiredException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ } | ||
|
||
public SecurityTokenExpiredException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ } | ||
} | ||
} | ||
#endif |
54 changes: 54 additions & 0 deletions
54
...ass/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenNotYetValidException.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// SecurityTokenNotYetValidException.cs | ||
// | ||
// Author: | ||
// Noesis Labs (Ryan.Melena@noesislabs.com) | ||
// | ||
// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
#if NET_4_5 | ||
|
||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace System.IdentityModel.Tokens | ||
{ | ||
public class SecurityTokenNotYetValidException : SecurityTokenValidationException | ||
{ | ||
public SecurityTokenNotYetValidException() | ||
: base("ID4182: The security token is not valid yet.") | ||
{ } | ||
|
||
public SecurityTokenNotYetValidException(string message) | ||
: base(message) | ||
{ } | ||
|
||
public SecurityTokenNotYetValidException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ } | ||
|
||
public SecurityTokenNotYetValidException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ } | ||
} | ||
} | ||
#endif |
54 changes: 54 additions & 0 deletions
54
.../System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenReplayDetectedException.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// SecurityTokenReplayDetectedException.cs | ||
// | ||
// Author: | ||
// Noesis Labs (Ryan.Melena@noesislabs.com) | ||
// | ||
// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
#if NET_4_5 | ||
|
||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace System.IdentityModel.Tokens | ||
{ | ||
public class SecurityTokenReplayDetectedException : SecurityTokenValidationException | ||
{ | ||
public SecurityTokenReplayDetectedException() | ||
: base("ID1070: Replay has been detected for a SecurityToken.") | ||
{ } | ||
|
||
public SecurityTokenReplayDetectedException(string message) | ||
: base(message) | ||
{ } | ||
|
||
public SecurityTokenReplayDetectedException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ } | ||
|
||
public SecurityTokenReplayDetectedException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ } | ||
} | ||
} | ||
#endif |
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
54 changes: 54 additions & 0 deletions
54
mcs/class/System.IdentityModel/System.IdentityModel/SignatureVerificationFailedException.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// SignatureVerificationFailedException.cs | ||
// | ||
// Author: | ||
// Noesis Labs (Ryan.Melena@noesislabs.com) | ||
// | ||
// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
#if NET_4_5 | ||
|
||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace System.IdentityModel | ||
{ | ||
public class SignatureVerificationFailedException : Exception | ||
{ | ||
public SignatureVerificationFailedException() | ||
: base("ID4038: Signature verification failed.") | ||
{ } | ||
|
||
public SignatureVerificationFailedException(string message) | ||
: base(message) | ||
{ } | ||
|
||
public SignatureVerificationFailedException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ } | ||
|
||
public SignatureVerificationFailedException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ } | ||
} | ||
} | ||
#endif |
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
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
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
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