Add Content Delivery API with OAuth configuration

Vote:
 

Hello,

We are trying to get the Content Delivery API working on an existing project (Episerver 11.10.2.0).

The default API is working, but we also want to use the OAuth possibility.

Therefore we need to add some lines to Startup.cs file.
But this file is missing in our project.

It's a project from one or two years ago.
So, what do we have to do? Create custom Startup.cs file? If so, with which code exactly?
What dow we have to do with the appSetting "owin:AutomaticAppStartup" value (should it be false or true)?

When we set the appSetting to true and add the following lines to our newly added Startup.cs file:

app.UseContentApiIdentityOAuthAuthorization<ApplicationUserManager<ApplicationUser>, ApplicationUser>(new ContentApiOAuthOptions()
{
      RequireSsl = false,
      AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(41),
      RefreshTokenExpireTimeSpan = TimeSpan.FromDays(14)
});

we got the following error when calling /api/episerver/v2.0/site/:

Hopefully someone can help us with this problem!

Thanks in advance.


Grtz Sander

#206898
Sep 03, 2019 13:46
Vote:
 
#206913
Edited, Sep 03, 2019 22:09
* 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.