Create portal session on behalf of user

Hi,

Is there a way to create a portal session on behalf of the user? We would like to give our user access to the portal. They are already authenticated on our SaaS. I find it cumbersome to force our user to create another account just to access the ERPNext portal (support, invoice, …)

Stripe has a similar feature [1] where you call (backend / server side) their API with the user ID you want to login to the portal, then you get a token and the user (frontend) to access the stripe portal.

[1] Stripe API reference – Create a portal session – curl

Best regards,

Sam

You can set-up SSO using OAuth.
Ref: How to setup OAuth 2?