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

Content Delivery API - With Azure AD B2C

Vote:
 

Hello Guys,

I would like to implement the Content Delivery API with Azure AD B2C.

With following guideline I was suppose to start my implemenation 

https://world.episerver.com/documentation/developer-guides/content-delivery-api/content-delivery-api-and-azure-ad/

But I am getting the method mentioned in the documentation


1) UserService.IsUserValid ( using EPiServer.ContentApi.Core.Internal.UserService) => Am i refering wrong dll/namespace.
2) RoleService.IsValidRole

I have already added class 
CustomContentApiRoutingEventHandler

and 

[InitializableModule]
[ModuleDependency(typeof(ServiceContainerInitialization), typeof(ContentApiCmsInitialization))]
public class ContentApiInitialization : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Services.AddTransient<RoutingEventHandler, CustomContentApiRoutingEventHandler>();
context.Services.AddTransient<ContentApiRouteService, CustomContentApiRouteService>();

// set minimumRoles to empty to allow anonymous calls (for visitors to view site in view mode)
context.Services.Configure<ContentApiConfiguration>(config =>
{
config.Default()
.SetMinimumRoles("ContentApiReaders")
.SetRequiredRole("ContentApiReaders")
.SetSiteDefinitionApiEnabled(true);
});

context.Services.Configure<ContentApiSearchConfiguration>(config =>
{
config.Default()
.SetMaximumSearchResults(200)
.SetSearchCacheDuration(TimeSpan.FromMinutes(60));
});
}

public void Initialize(InitializationEngine context)
{
// Method intentionally left empty.
}

public void Uninitialize(InitializationEngine context)
{
// Method intentionally left empty.
}
}

Is there anything I need to add in Starup.cs. Or Do I need to implement the custom authorization?

Please give me head start..!

Any reply appreciate.

Dipak

#231530
Nov 30, 2020 11:22
Johan Kronberg - Jan 11, 2021 15:55
Similar question here: https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2020/12/content-delivery-api---401-unauthorized/
Vote:
 

Hi Dipak Salve,

I don't really understand your question. 

Do you mean that you could not find the class UserService and RoleSerivce ?

#241034
Dec 10, 2020 3:11
* 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.