diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2011-04-07 08:01:44 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2011-04-07 08:01:44 -0700 |
commit | cb6027d9171f1411965e070a328e090594e3231c (patch) | |
tree | 2e12c640af6137b81fd765d19fdae8334d494d1f /projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs | |
parent | 7517491e79bb91241acbd46292006e8c999ec211 (diff) | |
download | DotNetOpenAuth-cb6027d9171f1411965e070a328e090594e3231c.zip DotNetOpenAuth-cb6027d9171f1411965e070a328e090594e3231c.tar.gz DotNetOpenAuth-cb6027d9171f1411965e070a328e090594e3231c.tar.bz2 |
Fixed static field initialization.
Diffstat (limited to 'projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs')
-rw-r--r-- | projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs b/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs index 0e4dc5c..2c9dc66 100644 --- a/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs +++ b/projecttemplates/RelyingPartyLogic/OAuthAuthenticationModule.cs @@ -49,13 +49,15 @@ namespace RelyingPartyLogic { return; } - var tokenAnalyzer = new SpecialAccessTokenAnalyzer(OAuthAuthorizationServer.AsymmetricKeyServiceProvider, OAuthAuthorizationServer.AsymmetricKeyServiceProvider); - var resourceServer = new ResourceServer(tokenAnalyzer); + using (var crypto = OAuthAuthorizationServer.CreateAsymmetricKeyServiceProvider()) { + var tokenAnalyzer = new SpecialAccessTokenAnalyzer(crypto, crypto); + var resourceServer = new ResourceServer(tokenAnalyzer); - IPrincipal principal; - var errorMessage = resourceServer.VerifyAccess(new HttpRequestInfo(this.application.Context.Request), out principal); - if (errorMessage == null) { - this.application.Context.User = principal; + IPrincipal principal; + var errorMessage = resourceServer.VerifyAccess(new HttpRequestInfo(this.application.Context.Request), out principal); + if (errorMessage == null) { + this.application.Context.User = principal; + } } } |