Example #1
0
        public async Task WhenGetRegisterUrlCalledWithoutParameterThenReturnUrlWithDefaultRedirect()
        {
            var client = new AzureB2CAuthClient(defaultSettings, tokenHandler, configurationManager);

            var url = await client.GetRegisterUrl();

            Assert.Contains(DefaultSignInRedirectUrl, url, StringComparison.InvariantCultureIgnoreCase);
        }
Example #2
0
        public async Task WhenGetRegisterUrlCalledAndUseOidConfigDiscoveryThenUseDiscoverySettings()
        {
            var settings = Options.Create(new OpenIDConnectSettings
            {
                UseOIDCConfigDiscovery = true,
                OIDCConfigMetaDataUrl  = "test",
                RedirectUrl            = DefaultSignInRedirectUrl,
                SignOutRedirectUrl     = DefaultSignOutRedirectUrl,
                Issuer        = "issuerFromServer",
                AuthdUrl      = "auth",
                AuthorizeUrl  = "AuthorizeUrl",
                ClientId      = "clientid",
                EndSessionUrl = "Endsesison",
                JWK           = "jjjjjjfhfjjfjfjfjfhfjkhdfkhdfkjhskfhsldkjhfskdljfhsdlkfhsdflksdhsdlkfh",
            });

            var client = new AzureB2CAuthClient(settings, tokenHandler, configurationManager);

            var token = await client.GetRegisterUrl().ConfigureAwait(true);

            A.CallTo(() => configurationManager.GetConfigurationAsync(CancellationToken.None)).MustHaveHappened();
        }