Skip to content

Commit

Permalink
added additional error check
Browse files Browse the repository at this point in the history
  • Loading branch information
leastprivilege committed May 5, 2016
1 parent e9aa75f commit 0859528
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions source/Clients/MVC OWIN Client (Hybrid)/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@ public void Configuration(IAppBuilder app)
{
// use the code to get the access and refresh token
var tokenClient = new TokenClient(
Constants.TokenEndpoint,
"mvc.owin.hybrid",
"secret");
Constants.TokenEndpoint,
"mvc.owin.hybrid",
"secret");

var tokenResponse = await tokenClient.RequestAuthorizationCodeAsync(
n.Code, n.RedirectUri);

if (tokenResponse.IsError)
{
throw new Exception(tokenResponse.Error);
}

// use the access token to retrieve claims from userinfo
var userInfoClient = new UserInfoClient(
new Uri(Constants.UserInfoEndpoint),
Expand Down

0 comments on commit 0859528

Please sign in to comment.