Basic OAuth token endpoint yielding 404
I have a very basic OAuth setup like this in my OWIN-based Startup.cs:
app.UseOAuthAuthorizationServer(new OAuthAuthorizationServerOptions
{
TokenEndpointPath = new PathString("/token"),
AccessTokenExpireTimeSpan = TimeSpan.FromHours(8),
Provider = new SimpleAuthorizationServerProvider(),
});
app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
The Web API controller routes work just fine, it's just the OAuth routes that seem to not be working (getting 404 status). Am I missing something? Let me know if I more details are needed. Obviously this all work in my local environment.
Discussions are closed to public comments.
If you need help with AppHarbor please
start a new discussion.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by rune on 29 Feb, 2016 08:07 PM
Hi,
I'm not sure what the issue might be here -- can you let me know the name of the application so I can take a closer look? Also, how can the issue be reproduced (i.e. does the application return the 404 when POSTing og GETing the
/tokensendpoint)?Best,
Rune
2 Posted by smonn on 01 Mar, 2016 08:03 AM
The name of the app is
ebb92bdae. It returns 404 for both POST and GET on that endpoint.The expected behavior is that if you send a POST request with the following headers and body:
You should get a JSON response:
Support Staff 3 Posted by rune on 04 Mar, 2016 05:00 AM
Hi again,
I suspect the issue might be related to the handler configuration in your
web.config:At least this suggests that requests to the
/APIendpoint should be handled differently than the defaults, so if the/APIroutes work as expected this might be worth looking into.Also, do you use IIS/IISexpress when testing locally? The configuration in the project files seems to indicate that a custom owin host is used during debugging. Using IIS (and likely IIS express) would bring the debugging environment closer to the AppHarbor environment, and might very well explain why you don't see the issue locally (as the
handlersconfiguration referenced above is specific to IIS).Best,
Rune