/// <summary> /// Constructs a profile data instance that will use the specified network identity /// during authentication with configured endpoint. /// </summary> /// <param name="profileName">The user-defined name of the profile that sourced this data.</param> /// <param name="endpointSettings">The settings for the authentication endpoint.</param> /// <param name="roleArn">The role that should be assumed on successful authentication.</param> /// <param name="userIdentity">The credentials to supply in authentication, in domain\user format.</param> private SAMLRoleProfile(string profileName, SAMLEndpointSettings endpointSettings, string roleArn, string userIdentity) { Name = profileName; EndpointSettings = endpointSettings; RoleArn = roleArn; UserIdentity = userIdentity; }
/// <summary> /// Attempts to load the settings defining a SAML endpoint. /// </summary> /// <param name="endpointName">The name assigned to the settings for the endpoint.</param> /// <param name="endpointSettings">The instantiated endpoint.</param> /// <returns>True if the settings were successfully loaded.</returns> public static bool TryGetSAMLEndpoint(string endpointName, out SAMLEndpointSettings endpointSettings) { endpointSettings = null; try { endpointSettings = SAMLEndpointSettings.LoadFrom(endpointName); } catch (Exception e) { Logger.GetLogger(typeof(ProfileManager)).Error(e, "Unable to load SAML endpoint profile '{0}', unknown profile or missing/invalid data.", endpointName); } return(endpointSettings != null); }
/// <summary> /// Registers an endpoint to be used in conjunction with SAML role profiles. The role profiles /// reference the endpoint settings to obtain the actual endpoint and any customization settings /// needed to perform authentication. /// </summary> /// <param name="endpointName">Name to be assigned to the endpoint settings.</param> /// <param name="endpoint">The full uri of the authentication endpoint.</param> /// <param name="authenticationType"> /// The authentication type to use when performing calls against the endpoint. Valid values are 'NTLM', /// 'Digest', 'Kerberos' and 'Negotiate'. The default if not configured (null/empty string) is 'Kerberos'. /// </param> /// <returns>The unique id assigned to the new settings.</returns> public static string RegisterSAMLEndpoint(string endpointName, Uri endpoint, string authenticationType) { return(SAMLEndpointSettings.Persist(endpointName, endpoint, authenticationType)); }