Skip to content

OpenID Connect login: profile sync and RP-initiated logout in provider-only mode - #909

Merged
KrzysztofPajak merged 4 commits into
developfrom
feature/oidc-provider-only-plugin
Oct 14, 2026
Merged

KrzysztofPajak merged 4 commits into
developfrom
feature/oidc-provider-only-plugin

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

Resolves no public issue
Type: feature

Issue

In the provider-only sign-in mode the identity provider owns the profile and the session, but the OpenID Connect login plugin kept GrandNode names and e-mail as they were at registration, showed a generic failure for an unverified e-mail, and could not end the provider session on sign-out.

Third of four stacked pull requests (core → web → plugin → guide); based on the web branch.

Solution

  • Profile sync on every provider sign-in in ProviderOnly: first and last name from given_name/family_name; the e-mail when the provider verified it and no other account uses it (per-store identity respected; case-only changes ignored); the username follows the e-mail only when usernames are disabled. A break-glass account keeps its e-mail (warning logged). A sync failure never blocks the sign-in.
  • Unverified e-mail refusal has its own message on the failure page.
  • "Connect your account" (link with password) is refused in ProviderOnly.
  • OidcSignOutProvider implements IExternalSignOutProvider: end_session_endpoint from the provider metadata with client_id and post_logout_redirect_uri; null when the method is unavailable, unconfigured or the metadata cannot be read.

Breaking changes

None. Mixed behaves exactly as before.

Testing

  1. dotnet test src/Tests/Grand.Modules.Tests (profile synchronizer, callback, sign-out provider).
  2. With SignInMode=ProviderOnly: rename the user at the provider and sign in again — first and last name follow; sign in with a user whose e-mail is not verified — the failure page explains it.
  3. Register the store home page (store URL + /) as a post-logout redirect URI at the provider, sign in and sign out — the provider session ends.

@KrzysztofPajak
KrzysztofPajak force-pushed the feature/oidc-provider-only-web branch from 629fc99 to 55ffa9b Compare October 14, 2026 10:39
@KrzysztofPajak
KrzysztofPajak force-pushed the feature/oidc-provider-only-plugin branch 2 times, most recently from ac817cc to e7d6340 Compare October 14, 2026 10:54
@KrzysztofPajak
KrzysztofPajak force-pushed the feature/oidc-provider-only-web branch from f64af00 to 297b569 Compare October 14, 2026 14:30
@KrzysztofPajak
KrzysztofPajak force-pushed the feature/oidc-provider-only-plugin branch from e7d6340 to 7d7bd4b Compare October 14, 2026 14:30
Base automatically changed from feature/oidc-provider-only-web to develop October 14, 2026 15:26
@KrzysztofPajak
KrzysztofPajak force-pushed the feature/oidc-provider-only-plugin branch from 7d7bd4b to efe1582 Compare October 14, 2026 16:15
Comment on lines +133 to +136
catch (Exception e)
{
_logger.LogWarning(e, "OpenID Connect profile sync failed for customer {CustomerId}", result.Customer.Id);
}
Comment on lines +38 to +44
catch (Exception ex)
{
//sign-out still finishes locally
logger.LogWarning("The identity provider metadata could not be read to end the session there ({Exception})",
ex.GetType().Name);
return null;
}
@KrzysztofPajak
KrzysztofPajak merged commit 87f171b into develop Oct 14, 2026
5 of 6 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the feature/oidc-provider-only-plugin branch October 14, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant