示例#1
0
        public DefaultIdSiteUrlBuilder(IInternalDataStore internalDataStore, string applicationHref, IIdSiteJtiProvider jtiProvider, IClock clock)
        {
            if (internalDataStore == null)
            {
                throw new ArgumentNullException(nameof(internalDataStore));
            }

            if (string.IsNullOrEmpty(applicationHref))
            {
                throw new ArgumentNullException(nameof(applicationHref));
            }

            if (jtiProvider == null)
            {
                throw new ArgumentNullException(nameof(jtiProvider));
            }

            if (clock == null)
            {
                throw new ArgumentNullException(nameof(clock));
            }

            this.internalDataStore = internalDataStore;
            this.jtiProvider       = jtiProvider;
            this.clock             = clock;
            this.applicationHref   = applicationHref;
            this.ssoEndpoint       = GetBaseUrl(applicationHref) + "/sso";
        }
        public DefaultIdSiteUrlBuilder(IInternalDataStore internalDataStore, string applicationHref, IIdSiteJtiProvider jtiProvider, IClock clock)
        {
            if (internalDataStore == null)
            {
                throw new ArgumentNullException(nameof(internalDataStore));
            }

            if (string.IsNullOrEmpty(applicationHref))
            {
                throw new ArgumentNullException(nameof(applicationHref));
            }

            if (jtiProvider == null)
            {
                throw new ArgumentNullException(nameof(jtiProvider));
            }

            if (clock == null)
            {
                throw new ArgumentNullException(nameof(clock));
            }

            this.internalDataStore = internalDataStore;
            this.jtiProvider = jtiProvider;
            this.clock = clock;
            this.applicationHref = applicationHref;
            this.ssoEndpoint = GetBaseUrl(applicationHref) + "/sso";
        }
示例#3
0
        public DefaultIdSiteUrlBuilder_tests()
        {
            this.fakeJtiProvider = Substitute.For <IIdSiteJtiProvider>();
            this.fakeJtiProvider.NewJti().Returns(this.fakeJti);

            this.fakeClock = Substitute.For <IClock>();
            this.fakeClock.Now.Returns(this.fakeNow);

            var testApiKey = ClientApiKeys.Builder()
                             .SetId(FakeApiKeyId)
                             .SetSecret(FakeApiKeySecret)
                             .Build();

            this.fakeClient = Clients.Builder()
                              .SetApiKey(testApiKey)
                              .Build();
        }
        public DefaultIdSiteUrlBuilder_tests()
        {
            this.fakeJtiProvider = Substitute.For<IIdSiteJtiProvider>();
            this.fakeJtiProvider.NewJti().Returns(this.fakeJti);

            this.fakeClock = Substitute.For<IClock>();
            this.fakeClock.Now.Returns(this.fakeNow);

            var testApiKey = ClientApiKeys.Builder()
                .SetId(FakeApiKeyId)
                .SetSecret(FakeApiKeySecret)
                .Build();

            this.fakeClient = Clients.Builder()
                .SetApiKey(testApiKey)
                .Build();
        }