Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IdentityServer4 - Loading login page in iframe

I need to change CSP in response that contains login page from IdentityServer4 in order to render that page in iframe in my client app. Is it possible?

like image 292
user3852961 Avatar asked Mar 06 '26 07:03

user3852961


1 Answers

Here you can find a sample MVC application where we have implemented a login mechanism to an IdentityServer4 instance using the authorization code flow but using an iframe. The flow is not that different from redirecting to the authority. Using an iframe just hides the redirection from the user which some believe provides a better user experience.

Regarding IdentityServer4 you need to add the this directive to the CSP. Also it would be good to configure your IS4 not to display a logout prompt, so you can have a seamless logout experience.

like image 84
Giorgos Manoltzas Avatar answered Mar 08 '26 20:03

Giorgos Manoltzas