Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Wiki - Security scenarios code example is incomplete #295

Closed
epiphone opened this issue Jul 1, 2013 · 0 comments
Closed

Wiki - Security scenarios code example is incomplete #295

epiphone opened this issue Jul 1, 2013 · 0 comments

Comments

@epiphone
Copy link

epiphone commented Jul 1, 2013

https://github.com/DotNetOpenAuth/DotNetOpenAuth/wiki/Security-scenarios

It seems that the following listing is incomplete?

Listing 5

public class TokenValidator
public class TokenValidator
{
       public void ValidateToken(dynamic tokenInfo, string expectedAudience)
       {
           var audience = tokenInfo.audience.ToString();
           if (string.IsNullOrEmpty(audience) || audience != expectedAudience)
           {
                  var e = new HttpException("tokes with unexpected audience: ");
                  throw e;
           }

       if (tokenInfo.expires_in == null) return;
       var expiresIn = tokenInfo.expires_in.ToString();
       int intExpiresIn;
       var isInt = int.TryParse(expiresIn, out intExpiresIn);

       if (!isInt || intExpiresIn

I tried it with Chrome and Firefox.

@epiphone epiphone closed this as completed Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant