Morten Sæther

← Blog

Custom Authentication Providers

#28 · 10 September 2026

Bringing your own identity provider, and why you probably should

Post 19 covered securing what happens after sign-in. This one’s about sign-in itself - connecting Power Pages to an identity provider your organisation already runs.

The short version: if there’s an existing identity provider, use it. Every credential store you add is another thing to secure, another password reset flow, and another place a departing employee’s access can linger.

The options

Power Pages supports the federation protocols - OpenID Connect, SAML 2.0, WS-Federation - plus local authentication where users get an account on the portal itself.

OpenID Connect is where I’d start for anything new. It’s the most widely supported, the easiest to debug, and the most likely to be what your provider recommends.

Local authentication exists and works. It also makes you responsible for password storage, reset flows, lockout policy and breach response. Use an external provider unless you have a reason not to.

Step by step

1. Work out who your users are

This decides everything else. Employees signing in with work accounts is a different problem from consumers who need to self-register, and both are different again from partner organisations that want their own tenant’s identities to work.

You may need more than one provider configured at once. That’s normal - just be clear about which audience gets which, and what happens when someone belongs to two.

2. Configure the provider

Registration happens on both ends: your portal needs the provider’s details, and the provider needs to know about your portal - the redirect URI it’s allowed to send users back to.

That redirect URI is environment-specific. One app registration can hold several redirect URIs, but keeping a separate registration per environment is what Microsoft recommends, so development URIs never sit in the production registration. Either way, a URI missing for the environment you just promoted to is the most common reason a working setup breaks.

3. Map identity to contact

This is the part that catches people. Power Pages authorises against a contact record, so an authenticated identity has to resolve to one.

Decide what happens when someone signs in successfully and there’s no matching contact: create one automatically, or refuse and tell them to get in touch. Both are legitimate; the wrong one for your situation is either a portal full of empty contacts or a support queue full of confused partners.

Match on something stable. Email addresses change, and matching on one that does leaves you with a duplicate contact and a user who lost their history.

4. Handle claims and roles

Claims mapping copies values from the token into text and boolean columns on the contact at registration and sign-in. It does not assign web roles. If you want group membership from the provider to drive portal roles, you build that yourself: map the claim to a contact column, then assign the web roles from that column yourself.

It’s a reduction in administration, and it comes with a coupling cost: your access control now depends on the group structure in another system, which someone else changes without telling you. Worth it, usually, but know that you’ve made that trade.

5. Test the paths nobody thinks about

Sign-in works on the first try in the demo. The interesting cases are the others: a user who abandons the flow halfway, one whose session expires mid-form, one whose access is revoked while signed in, one who signs out at the provider but not the portal.

Sign-out especially. Users assume signing out ends the session everywhere. Whether it does depends on how you’ve configured federated sign-out, and the gap between assumption and reality is a security problem on shared machines.

How to make a mess and fix it

Redirect URI mismatch. Almost always environment-specific registration. Check which URI the provider has for this environment.

Signed in, but treated as anonymous. The identity didn’t resolve to a contact record.

Roles not applying. Claims mapping only fills contact columns. Check what’s in the token, then check whatever assigns the web role from it.

Signed out of the portal but straight back in. The provider session is still live. That’s federated sign-out configuration.

Wrapping up

Use an existing identity provider, be deliberate about identity-to-contact mapping, match on something stable, and test the unhappy paths - especially sign-out.

Next: DevOps, and getting all of this between environments without doing it by hand.