Ejemplo n.º 1
0
        // [InlineData(AuthenticateEndpoints.Refresh)]
        // [InlineData(AuthenticateEndpoints.Validate)]
        // [InlineData(AuthenticateEndpoints.Invalidate)]
        // [InlineData(AuthenticateEndpoints.Signout)]
        public void Test3(AuthenticateEndpoints authenticateEndpoints)
        {
            var expect = "authenticate";
            var actual = authenticateEndpoints.GetValue();

            Assert.Equal(expect, actual);
        }
Ejemplo n.º 2
0
        public static string GetPayload(this OnlineAuthenticator authenticator, AuthenticateEndpoints endpoints)
        {
            switch (endpoints)
            {
            case AuthenticateEndpoints.Authenticate:
                return(GetAuthenticatePayload(authenticator));

            case AuthenticateEndpoints.Signout:
                return(GetSignoutPayload(authenticator));

            case AuthenticateEndpoints.Refresh:
            case AuthenticateEndpoints.Validate:
            case AuthenticateEndpoints.Invalidate:
                throw new ArgumentOutOfRangeException(nameof(endpoints), endpoints, null);

            default:
                throw new ArgumentOutOfRangeException(nameof(endpoints), endpoints, null);
            }
        }
Ejemplo n.º 3
0
 public static async Task <HttpResponse> Post(AuthenticateEndpoints endpoints, string json)
 {
     return(await Post($"https://authserver.mojang.com/{endpoints.GetValue()}", json));
 }
Ejemplo n.º 4
0
 public static string GetValue(this AuthenticateEndpoints ex)
 {
     return(ex.ToString().ToLower());
 }