Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login is returning an invalid token #7

Open
tanis2000 opened this issue Mar 15, 2016 · 0 comments
Open

Login is returning an invalid token #7

tanis2000 opened this issue Mar 15, 2016 · 0 comments

Comments

@tanis2000
Copy link

I noticed that at this line https://github.com/SoftUni/SPA-with-AngularJS/blob/master/Ads-REST-Services/Ads.Web/Controllers/UserController.cs#L122 you're using the TestServer class to issue the new token. I noticed that the token isn't working if you then pass it to any authorized method.

Instead I replaced that code with:

            HttpClient hc = new HttpClient();
            var request = HttpContext.Current.Request;
            var tokenServiceResponse = await hc.PostAsync(string.Format("{0}://{1}", request.Url.Scheme, request.Url.Authority) + Startup.OAuthOptions.TokenEndpointPath.ToString(), requestParamsFormUrlEncoded);

This way it's actually calling our real /Token route and retrieving a valid token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant