Skip to content

Commit 528636d

Browse files
Check client identifier is a URI
1 parent 54a6a1f commit 528636d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/IdServer/SimpleIdServer.IdServer.Federation/Helpers/FederationClientHelper.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@ public override async Task<Client> ResolveClient(string realm, string clientId,
3636
{
3737
var result = await base.ResolveClient(realm, clientId, cancellationToken);
3838
if (result == null)
39-
result = await _clientRegistrationService.AutomaticRegisterClient(realm, clientId, cancellationToken);
39+
{
40+
if (Uri.TryCreate(clientId, UriKind.Absolute, out Uri uri) && uri != null && uri.Scheme != null && uri.Scheme.StartsWith("http", StringComparison.InvariantCultureIgnoreCase))
41+
{
42+
result = await _clientRegistrationService.AutomaticRegisterClient(realm, clientId, cancellationToken);
43+
}
44+
}
4045
else
46+
{
4147
await RenewClientTrustChain(realm, result, cancellationToken);
48+
}
4249

4350
return result;
4451
}

0 commit comments

Comments
 (0)