예제 #1
0
    public static void Validate_Does_Not_Throw_If_ClientSecret_Is_Not_Provided_For_Public_Access_Type(string clientSecret)
    {
        // Arrange
        var options = new KeycloakAuthenticationOptions()
        {
            AccessType   = KeycloakAuthenticationAccessType.Public,
            ClientId     = "my-client-id",
            ClientSecret = clientSecret,
        };

        // Act (no Assert)
        options.Validate();
    }
예제 #2
0
    public static void Validate_Throws_If_CallbackPath_Is_Null(KeycloakAuthenticationAccessType accessType)
    {
        // Arrange
        var options = new KeycloakAuthenticationOptions()
        {
            AccessType   = accessType,
            CallbackPath = null,
            ClientId     = "my-client-id",
            ClientSecret = "my-client-secret",
        };

        // Act and Assert
        Assert.Throws <ArgumentException>("CallbackPath", () => options.Validate());
    }