Esempio n. 1
0
        public void LogoutCommand_InitiateLogout_NullcheckOptions()
        {
            Action a = () => LogoutCommand.InitiateLogout(
                new HttpRequestData("GET", new Uri("http://l")),
                null,
                null,
                false);

            a.Should().Throw <ArgumentNullException>().And.ParamName.Should().Be("options");
        }
Esempio n. 2
0
        /// <summary>
        /// Initiate a federated sign out if supported (Idp supports it and sp has a configured
        /// signing certificate)
        /// </summary>
        /// <param name="properties">Authentication props, containing a return url.</param>
        /// <returns>Task</returns>
        public async Task SignOutAsync(AuthenticationProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            await LogoutCommand.InitiateLogout(
                context.ToHttpRequestData(dataProtector.Unprotect),
                new Uri(properties.RedirectUri, UriKind.RelativeOrAbsolute),
                options,
                // In the Asp.Net Core2 model, it's the caller's responsibility to terminate the
                // local session on an SP-initiated logout.
                terminateLocalSession : false)
            .Apply(context, dataProtector, null, null);
        }
Esempio n. 3
0
        public void LogoutCommand_InitiateLogout_NullcheckRequest()
        {
            Action a = () => LogoutCommand.InitiateLogout(null, null, null, false);

            a.Should().Throw <ArgumentNullException>().And.ParamName.Should().Be("request");
        }