Logging in with a guest account in Azure AD B2C

Rory Braybrook
The new control plane
Dec 19, 2023
Image of guest user

This is similar to my previous post.

It uses the embedded technique in this sample.

Basically, when the user logs in, they pick the guest option, maybe enter some attributes that the application needs and redirect to the application without actually logging in.

Image of sign in screen showing local account and guest account buttons

The JWT that is sent to the application contains a flag to say that this is a guest user.

Image of JWT showing guestUser = true

The user has not authenticated in the sense of username / password!

Note: The MSAL library assumes that the return of a valid JWT implies that the user has logged on so be prepared to handle this. Use at your own risk.

As usual, the custom policy is in a gist.

All good!

--

--

Rory Braybrook
The new control plane

NZ Microsoft Identity dude and MVP. Azure AD/B2C/ADFS/Auth0/identityserver. StackOverflow: https://bit.ly/2XU4yvJ Presentations: http://bit.ly/334ZPt5