| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Security.Claims; |
| | | 5 | | |
| | | 6 | | namespace CoreWCF.IdentityModel.Tokens |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Interface that defines the name service that returns that issuer name |
| | | 10 | | /// of a given token as string. |
| | | 11 | | /// </summary> |
| | | 12 | | public abstract class IssuerNameRegistry //: ICustomIdentityConfiguration |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// When implemented in the derived class, the method returns the issuer name of the given |
| | | 16 | | /// SecurityToken's issuer. Implementations must return a non-null and non-empty string to |
| | | 17 | | /// identify a recognized issuer, or a null string to identify an unrecognized issuer. |
| | | 18 | | /// </summary> |
| | | 19 | | /// <param name="securityToken">The SecurityToken whose name is requested.</param> |
| | | 20 | | /// <returns>Issuer name as a string.</returns> |
| | | 21 | | public abstract string GetIssuerName( SecurityToken securityToken ); |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// When implemented in the derived class the method returns the issuer name |
| | | 25 | | /// of the given SecurityToken's issuer. The requested issuer name may be considered |
| | | 26 | | /// in determining the issuer's name. |
| | | 27 | | /// </summary> |
| | | 28 | | /// <param name="securityToken">The SecurityToken whose name is requested.</param> |
| | | 29 | | /// <param name="requestedIssuerName">Input to determine the issuer name</param> |
| | | 30 | | /// <remarks>The default implementation ignores the requestedIsserName parameter and simply calls the |
| | | 31 | | /// GetIssuerName( SecurityToken securityToken ) method</remarks> |
| | | 32 | | /// <returns>Issuer name as a string.</returns> |
| | | 33 | | public virtual string GetIssuerName( SecurityToken securityToken, string requestedIssuerName ) |
| | | 34 | | { |
| | 32 | 35 | | return GetIssuerName( securityToken ); |
| | | 36 | | } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// This function returns the default issuer name to be used for Windows claims. |
| | | 40 | | /// </summary> |
| | | 41 | | /// <returns>Issuer name as a string.</returns> |
| | | 42 | | public virtual string GetWindowsIssuerName() |
| | | 43 | | { |
| | 0 | 44 | | return ClaimsIdentity.DefaultIssuer; |
| | | 45 | | } |
| | | 46 | | } |
| | | 47 | | } |