/// <summary> /// Constructor for receiving a request. /// </summary> /// <param name="tokenEndpoint"></param> /// <param name="version"></param> internal AccessTokenAssertionRequest(Uri tokenEndpoint, Version version) : base(version, MessageTransport.Direct, tokenEndpoint) { mAssertionProvider = new MyAssertionStorage(); this.HttpMethods = HttpDeliveryMethods.PostRequest; this.Scope = new HashSet <string>(OAuthUtilities.ScopeStringComparer); }
/// <summary> /// Constructor for sending a request. /// An IAssertionProvider must be given so that assertion data can be queried from it. /// </summary> /// <param name="assertProv"></param> /// <param name="tokenEndpoint"></param> /// <param name="version"></param> internal AccessTokenAssertionRequest(IAssertionProvider assertProv, Uri tokenEndpoint, Version version) : base(version, MessageTransport.Direct, tokenEndpoint) { Requires.NotNull(assertProv, "assertProv"); mAssertionProvider = assertProv; this.HttpMethods = HttpDeliveryMethods.PostRequest; this.Scope = new HashSet <string>(OAuthUtilities.ScopeStringComparer); }
/// <summary> /// Constructor when using the GetAssertionAccessTokenAsync() method. /// </summary> /// <param name="authorizationServer"></param> /// <param name="assertionProvider">This will be queried for the assertion data.</param> /// <param name="hostFactories"></param> protected ClientBase(AuthorizationServerDescription authorizationServer, IAssertionProvider assertionProvider, IHostFactories hostFactories = null) { Requires.NotNull(authorizationServer, "authorizationServer"); this.AuthorizationServer = authorizationServer; this.Channel = new OAuth2ClientChannel(hostFactories); // YTML: A bit hacky, but instead of creating a new property, we can just wrap the assertionProvider as a credential applicator. this.ClientCredentialApplicator = new ClientCredentialApplicator.AssertionProviderApplicator(assertionProvider); }
internal AssertionProviderApplicator(IAssertionProvider ap) { this.AssertionProvider = ap; }