Browse Source

Avoid mutating the issuer set in the options when computing the absolute OIDC metadata address

pull/1161/head
Kévin Chalet 6 years ago
parent
commit
970249b177
  1. 2
      src/OpenIddict.Abstractions/Resources/OpenIddictResources.resx
  2. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.ar.xlf
  3. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.de.xlf
  4. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.es.xlf
  5. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.fr.xlf
  6. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.gu.xlf
  7. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.hi.xlf
  8. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.it.xlf
  9. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.nl.xlf
  10. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.tr.xlf
  11. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.zh-Hans.xlf
  12. 4
      src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.zh-Hant.xlf
  13. 11
      src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs

2
src/OpenIddict.Abstractions/Resources/OpenIddictResources.resx

@ -1676,7 +1676,7 @@ To register the OpenIddict core services, reference the 'OpenIddict.Core' packag
<value>A server configuration containing an invalid issuer was returned.</value>
</data>
<data name="ID2098" xml:space="preserve">
<value>The issuer returned in the server configuration is not valid.</value>
<value>The issuer returned in the server configuration doesn't match the value set in the validation options.</value>
</data>
<data name="ID2099" xml:space="preserve">
<value>No JWKS endpoint could be found in the server configuration.</value>

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.ar.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">المُصدر الذي تم إرجاعه في إعدادات الخادم غير صالح.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">المُصدر الذي تم إرجاعه في إعدادات الخادم غير صالح.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.de.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">Der in der Serverkonfiguration zurückgegebene Issuer ist nicht gültig.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">Der in der Serverkonfiguration zurückgegebene Issuer ist nicht gültig.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.es.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">El emisor devuelto en la configuración del servidor no es válido.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">El emisor devuelto en la configuración del servidor no es válido.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.fr.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">L'émetteur retourné dans la configuration du serveur n'est pas valide.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="translated">L'émetteur retourné dans la configuration du serveur ne correspond pas à la valeur définie dans les options de validation.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.gu.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">સર્વર ગોઠવણીમાં પાછો આપનાર માન્ય નથી.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">સર્વર ગોઠવણીમાં પાછો આપનાર માન્ય નથી.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.hi.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">सर्वर कॉन्फ़िगरेशन में जारीकर्ता मान्य नहीं है.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">सर्वर कॉन्फ़िगरेशन में जारीकर्ता मान्य नहीं है.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.it.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">L'emittente restituito nella configurazione del server non è valido.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">L'emittente restituito nella configurazione del server non è valido.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.nl.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">De uitgever die in de serverconfiguratie is geretourneerd, is niet geldig.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">De uitgever die in de serverconfiguratie is geretourneerd, is niet geldig.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.tr.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">Sunucu yapılandırmasında döndürülen kuruluş yanıtı geçerli değil.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">Sunucu yapılandırmasında döndürülen kuruluş yanıtı geçerli değil.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.zh-Hans.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">服务器配置中返回的颁发者无效.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">服务器配置中返回的颁发者无效.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

4
src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.zh-Hant.xlf

@ -473,8 +473,8 @@
<note />
</trans-unit>
<trans-unit id="ID2098">
<source>The issuer returned in the server configuration is not valid.</source>
<target state="translated">伺服器配置中返回的頒發者無效.</target>
<source>The issuer returned in the server configuration doesn't match the value set in the validation options.</source>
<target state="needs-review-translation">伺服器配置中返回的頒發者無效.</target>
<note />
</trans-unit>
<trans-unit id="ID2099">

11
src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs

@ -112,19 +112,20 @@ namespace OpenIddict.Validation
if (!options.MetadataAddress.IsAbsoluteUri)
{
if (options.Issuer is null || !options.Issuer.IsAbsoluteUri)
var issuer = options.Issuer;
if (issuer is null || !issuer.IsAbsoluteUri)
{
throw new InvalidOperationException(SR.GetResourceString(SR.ID0136));
}
if (!string.IsNullOrEmpty(options.Issuer.Fragment) || !string.IsNullOrEmpty(options.Issuer.Query))
if (!string.IsNullOrEmpty(issuer.Fragment) || !string.IsNullOrEmpty(issuer.Query))
{
throw new InvalidOperationException(SR.GetResourceString(SR.ID0137));
}
if (!options.Issuer.OriginalString.EndsWith("/"))
if (!issuer.OriginalString.EndsWith("/"))
{
options.Issuer = new Uri(options.Issuer.OriginalString + "/", UriKind.Absolute);
issuer = new Uri(issuer.OriginalString + "/", UriKind.Absolute);
}
if (options.MetadataAddress.OriginalString.StartsWith("/"))
@ -133,7 +134,7 @@ namespace OpenIddict.Validation
1, options.MetadataAddress.OriginalString.Length - 1), UriKind.Relative);
}
options.MetadataAddress = new Uri(options.Issuer, options.MetadataAddress);
options.MetadataAddress = new Uri(issuer, options.MetadataAddress);
}
options.ConfigurationManager = new ConfigurationManager<OpenIdConnectConfiguration>(

Loading…
Cancel
Save