public static async Task <GetOAuthTokenResponse> GetToken(this ISquidexOAuthClient that, string oauthAppName, string oauthClientId, string oauthClientSecret) { // mabye just move this to the inteface var response = await that.GetToken(new GetOAuthTokenRequest { ClientId = $"{oauthAppName}:{oauthClientId}", ClientSecret = oauthClientSecret }); return(response); }
public BaseHandlerIntegrationTest() { var _applicationConfiguration = new TestConfigurationOptions(); var configurationRoot = TestHelper.GetConfigurationRoot(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); configurationRoot.Bind(_applicationConfiguration); var oauthAppName = _applicationConfiguration.Clients["aut-developer"].OAuthAppName; var oauthClientId = _applicationConfiguration.Clients["aut-developer"].OAuthClientId; var oauthClientSecret = _applicationConfiguration.Clients["aut-developer"].OAuthClientSecret; var baseAddress = _applicationConfiguration.BaseAddressUri; this.SchemaClient = this.GetOAuthSecuredClient <ISquidexAppSchemaClient>(oauthAppName, oauthClientId, oauthClientSecret, baseAddress); this.ContentClient = this.GetOAuthSecuredClient <ISquidexContentClient>(oauthAppName, oauthClientId, oauthClientSecret, baseAddress); this.AttachmentClient = this.GetOAuthSecuredClient <ISquidexAttachmentClient>(oauthAppName, oauthClientId, oauthClientSecret, baseAddress); this.OAuthClient = this.GetUnsecuredClient <ISquidexOAuthClient>(baseAddress); }