November Happy Hour will be moved to Thursday December 5th.

Content Delivery API - 404 on /api/episerver/auth/token

Vote:
 

Hiya Folks,

I'm currently in the process of figuring out how to work with the episerver content delivery API, and have added that package to a simple test project (build from an empty project), only using the episerver cms (no search, commerce or anything). 

Now if i access the /api/episerver/v2.0/site from a browser after logging in on the cms, I get a JSON containing quite some info. However when I access query for the same thing using postman or a browser that has not been logged in to the CMS I get a JSON containing only an Unauthorized error. Seems to me I should be able to fix this querying /api/episerver/auth/token to get an authorization token, yet when I try that I get an 404 error page (in html).

Does anyone know what I am missing or why i cannot get to auth/token?

PS: I do have Episerver.ContentDeliveryApi.OAuth in my references (Used nuget to install Episerver.ContentDeliveryApi)

#199413
Nov 26, 2018 16:30
Vote:
 

Hi Willemvs,

Have you had such the following lines of code at the bottom in Startup.cs file

//// Episerver Content API Authorization
app.UseContentApiIdentityOAuthAuthorization<ApplicationUserManager<ApplicationUser>, ApplicationUser>(new ContentApiOAuthOptions()
{
    RequireSsl = false
});
#199421
Nov 27, 2018 3:23
Vote:
 

Thank you. I have managed to get it up and running using the code you provided. 

#199426
Nov 27, 2018 13:26
Vote:
 

Hi Willemvs,

For more information about configuration, please visit Content Delivery Api Doc

#199458
Nov 28, 2018 7:48
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.