Initial Commit ...
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using xCommons.Extensions;
|
||||
using xIdentityModels.Constants;
|
||||
|
||||
namespace xIdentityModels.Models {
|
||||
public class XActionRequestToken {
|
||||
public XAction Action { get; set; }
|
||||
public XActionRequestContext Context { get; set; }
|
||||
public string Token { get; set; }
|
||||
|
||||
public void Prepare (string secret) {
|
||||
Token = (Action.ToString () +
|
||||
secret +
|
||||
Context.ToJSON ()).ToMd5String ();
|
||||
}
|
||||
|
||||
public bool Validate (string secret) {
|
||||
return (Action.ToString () +
|
||||
secret +
|
||||
Context.ToJSON ()).ToMd5String () == Token;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user