Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceProvider"/> class.
        /// </summary>
        /// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
        /// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
        /// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
        public ServiceProvider(ServiceProviderDescription serviceDescription, ITokenManager tokenManager, OAuthServiceProviderMessageFactory messageTypeProvider)
        {
            if (serviceDescription == null) {
                throw new ArgumentNullException("serviceDescription");
            }
            if (tokenManager == null) {
                throw new ArgumentNullException("tokenManager");
            }
            if (messageTypeProvider == null) {
                throw new ArgumentNullException("messageTypeProvider");
            }

            var signingElement = serviceDescription.CreateTamperProtectionElement();
            INonceStore store = new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge);
            this.ServiceDescription = serviceDescription;
            this.OAuthChannel = new OAuthChannel(signingElement, store, tokenManager, messageTypeProvider);
            this.TokenGenerator = new StandardTokenGenerator();
        }
Пример #2
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceProvider"/> class.
		/// </summary>
		/// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
		/// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
		/// <param name="nonceStore">The nonce store.</param>
		/// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
		public ServiceProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, INonceStore nonceStore, OAuthServiceProviderMessageFactory messageTypeProvider) {
			Requires.NotNull(serviceDescription, "serviceDescription");
			Requires.NotNull(tokenManager, "tokenManager");
			Requires.NotNull(nonceStore, "nonceStore");
			Requires.NotNull(messageTypeProvider, "messageTypeProvider");

			var signingElement = serviceDescription.CreateTamperProtectionElement();
			this.ServiceDescription = serviceDescription;
			this.SecuritySettings = OAuthElement.Configuration.ServiceProvider.SecuritySettings.CreateSecuritySettings();
			this.OAuthChannel = new OAuthServiceProviderChannel(signingElement, nonceStore, tokenManager, this.SecuritySettings, messageTypeProvider);
			this.TokenGenerator = new StandardTokenGenerator();

			OAuthReporting.RecordFeatureAndDependencyUse(this, serviceDescription, tokenManager, nonceStore);
		}
Пример #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceProvider"/> class.
		/// </summary>
		/// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
		/// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
		/// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
		public ServiceProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, OAuthServiceProviderMessageFactory messageTypeProvider)
			: this(serviceDescription, tokenManager, OAuthElement.Configuration.ServiceProvider.ApplicationStore.CreateInstance(HttpApplicationStore), messageTypeProvider) {
			Requires.NotNull(serviceDescription, "serviceDescription");
			Requires.NotNull(tokenManager, "tokenManager");
			Requires.NotNull(messageTypeProvider, "messageTypeProvider");
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceProviderOpenIdProvider"/> class.
		/// </summary>
		/// <param name="serviceDescription">The service description.</param>
		/// <param name="tokenManager">The token manager.</param>
		/// <param name="nonceStore">The nonce store.</param>
		/// <param name="messageTypeProvider">The message type provider.</param>
		public ServiceProviderOpenIdProvider(ServiceProviderHostDescription serviceDescription, IServiceProviderTokenManager tokenManager, INonceStore nonceStore, OAuthServiceProviderMessageFactory messageTypeProvider)
			: base(serviceDescription, tokenManager, nonceStore, messageTypeProvider) {
		}
Пример #5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceProvider"/> class.
		/// </summary>
		/// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
		/// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
		/// <param name="nonceStore">The nonce store.</param>
		/// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
		public ServiceProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, INonceStore nonceStore, OAuthServiceProviderMessageFactory messageTypeProvider) {
			Contract.Requires<ArgumentNullException>(serviceDescription != null);
			Contract.Requires<ArgumentNullException>(tokenManager != null);
			Contract.Requires<ArgumentNullException>(nonceStore != null);
			Contract.Requires<ArgumentNullException>(messageTypeProvider != null);

			var signingElement = serviceDescription.CreateTamperProtectionElement();
			this.ServiceDescription = serviceDescription;
			this.OAuthChannel = new OAuthChannel(signingElement, nonceStore, tokenManager, messageTypeProvider);
			this.TokenGenerator = new StandardTokenGenerator();
			this.SecuritySettings = DotNetOpenAuthSection.Configuration.OAuth.ServiceProvider.SecuritySettings.CreateSecuritySettings();

			Reporting.RecordFeatureAndDependencyUse(this, serviceDescription, tokenManager, nonceStore);
		}
Пример #6
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceProvider"/> class.
		/// </summary>
		/// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
		/// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
		/// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
		public ServiceProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, OAuthServiceProviderMessageFactory messageTypeProvider)
			: this(serviceDescription, tokenManager, DotNetOpenAuthSection.Configuration.OAuth.ServiceProvider.ApplicationStore.CreateInstance(HttpApplicationStore), messageTypeProvider) {
			Contract.Requires<ArgumentNullException>(serviceDescription != null);
			Contract.Requires<ArgumentNullException>(tokenManager != null);
			Contract.Requires<ArgumentNullException>(messageTypeProvider != null);
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceProviderOpenIdProvider"/> class.
		/// </summary>
		/// <param name="serviceDescription">The service description.</param>
		/// <param name="tokenManager">The token manager.</param>
		/// <param name="messageTypeProvider">The message type provider.</param>
		public ServiceProviderOpenIdProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, OAuthServiceProviderMessageFactory messageTypeProvider)
			: base(serviceDescription, tokenManager, messageTypeProvider) {
		}
Пример #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceProvider"/> class.
        /// </summary>
        /// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
        /// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
        /// <param name="nonceStore">The nonce store.</param>
        /// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
        public ServiceProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, INonceStore nonceStore, OAuthServiceProviderMessageFactory messageTypeProvider)
        {
            ErrorUtilities.VerifyArgumentNotNull(serviceDescription, "serviceDescription");
            ErrorUtilities.VerifyArgumentNotNull(tokenManager, "tokenManager");
            ErrorUtilities.VerifyArgumentNotNull(nonceStore, "nonceStore");
            ErrorUtilities.VerifyArgumentNotNull(messageTypeProvider, "messageTypeProvider");

            var signingElement = serviceDescription.CreateTamperProtectionElement();
            this.ServiceDescription = serviceDescription;
            this.OAuthChannel = new OAuthChannel(signingElement, nonceStore, tokenManager, messageTypeProvider);
            this.TokenGenerator = new StandardTokenGenerator();
            this.SecuritySettings = DotNetOpenAuthSection.Configuration.OAuth.ServiceProvider.SecuritySettings.CreateSecuritySettings();
        }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServiceProvider"/> class.
 /// </summary>
 /// <param name="serviceDescription">The endpoints and behavior on the Service Provider.</param>
 /// <param name="tokenManager">The host's method of storing and recalling tokens and secrets.</param>
 /// <param name="messageTypeProvider">An object that can figure out what type of message is being received for deserialization.</param>
 public ServiceProvider(ServiceProviderDescription serviceDescription, IServiceProviderTokenManager tokenManager, OAuthServiceProviderMessageFactory messageTypeProvider)
     : this(serviceDescription, tokenManager, new NonceMemoryStore(StandardExpirationBindingElement.DefaultMaximumMessageAge), messageTypeProvider)
 {
 }