How to get the Service Api to use Azure AD



Episerver Admin login is successfully working using Azure AD, but I can't seem to get the Service Api to use it. I can only login to the Service Api by using the built in authentication. Is the Service Api even compatible with Azure AD? Any ideas on what I can try?


Aug 26, 2021 16:01

Yeah, out-of-the-box you will need to obtain a bearer token from ServiceAPI.

But since ServiceAPI is built on top of WebAPI, you can make it support other OWIN-based authentication methods.

The below code sample can be added to an initialization module.

// Make an initialization module, and decorate it with this attribute.

// Add this inside the Initialize method.
GlobalConfiguration.Configure(config =>
	config.Filters.Add(new HostAuthenticationFilter(DefaultAuthenticationTypes.ApplicationCookie));

DefaultAuthenticationTypes.ApplicationCookie refers to the default cookie-based ASP.Net Identity authentication. If you used another name in your Azure AD integration, use that instead.

Aug 28, 2021 15:51
* 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.