Skip to content

Commit 0e897f9

Browse files
committed
Allow not loading profile information from user info endpoint
1 parent afbab10 commit 0e897f9

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

SSO-Auth/Api/SSOController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public async Task<ActionResult> OidPost(
114114
Scope = string.Join(" ", scopes.Prepend("openid profile")),
115115
DisablePushedAuthorization = config.DisablePushedAuthorization,
116116
LoggerFactory = _loggerFactory,
117+
LoadProfile = !config.DoNotLoadProfile,
117118
};
118119
var oidEndpointUri = new Uri(config.OidEndpoint?.Trim());
119120
options.Policy.Discovery.AdditionalEndpointBaseAddresses.Add(oidEndpointUri.GetLeftPart(UriPartial.Authority));
@@ -340,6 +341,7 @@ public async Task<ActionResult> OidChallenge(string provider, [FromQuery] bool i
340341
Scope = string.Join(" ", config.OidScopes.Prepend("openid profile")),
341342
DisablePushedAuthorization = config.DisablePushedAuthorization,
342343
LoggerFactory = _loggerFactory,
344+
LoadProfile = !config.DoNotLoadProfile,
343345
};
344346
var oidEndpointUri = new Uri(config.OidEndpoint?.Trim());
345347
options.Policy.Discovery.AdditionalEndpointBaseAddresses.Add(oidEndpointUri.GetLeftPart(UriPartial.Authority));

SSO-Auth/Config/PluginConfiguration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ public SerializableDictionary<string, Guid> CanonicalLinks
327327
/// Gets or sets a value indicating whether the OpenID issuer name is validated.
328328
/// </summary>
329329
public bool DoNotValidateIssuerName { get; set; }
330+
331+
/// <summary>
332+
/// Gets or sets a value indicating whether the UserInfo endpoint is used to get profile data.
333+
/// </summary>
334+
public bool DoNotLoadProfile { get; set; }
330335
}
331336

332337
/// <summary>

SSO-Auth/Config/configPage.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,23 @@ <h2 class="sectionTitle">SSO Settings:</h2>
637637
<span>Do Not Validate OpenID Issuer Name (Insecure)</span>
638638
</label>
639639
</div>
640+
<div
641+
class="checkboxContainer checkboxContainer-withDescription"
642+
>
643+
<label>
644+
<input
645+
is="emby-checkbox"
646+
id="DoNotLoadProfile"
647+
name="DoNotLoadProfile"
648+
type="checkbox"
649+
class="sso-toggle"
650+
/>
651+
<span>Do Not Load Profile Information</span>
652+
</label>
653+
<div class="fieldDescription checkboxFieldDescription">
654+
May be required for Cloudflare OpenID
655+
</div>
656+
</div>
640657

641658
<div class="inputContainer">
642659
<label class="inputLabel inputLabelUnfocused" for="RoleClaim"

0 commit comments

Comments
 (0)