package com.github.scribejava.core.builder.api;

import com.github.scribejava.core.java8.Base64;
import com.github.scribejava.core.model.OAuthConstants;
import com.github.scribejava.core.model.OAuthRequest;
import java.nio.charset.Charset;

/**
 * Represents<br>
 * 2.3. Client Authentication<br>
 * https://tools.ietf.org/html/rfc6749#section-2.3 <br>
 * in it's part 2.3.1. Client Password<br>
 * https://tools.ietf.org/html/rfc6749#section-2.3.1
 */
public enum ClientAuthenticationType {
    HTTP_BASIC_AUTHENTICATION_SCHEME {
        private final Base64.Encoder base64Encoder = Base64.getEncoder();

        @Override
        public void addClientAuthentication(OAuthRequest request, String apiKey, String apiSecret) {
            if (apiKey != null && apiSecret != null) {
                request.addHeader(OAuthConstants.HEADER, OAuthConstants.BASIC + ' '
                        + base64Encoder.encodeToString(
                                String.format("%s:%s", apiKey, apiSecret).getBytes(Charset.forName("UTF-8"))));
            }
        }
    },
    REQUEST_BODY {
        @Override
        public void addClientAuthentication(OAuthRequest request, String apiKey, String apiSecret) {
            request.addParameter(OAuthConstants.CLIENT_ID, apiKey);
            if (apiSecret != null) {
                request.addParameter(OAuthConstants.CLIENT_SECRET, apiSecret);
            }
        }
    };

    public abstract void addClientAuthentication(OAuthRequest request, String apiKey, String apiSecret);
}

@@ -457,12 +457,22 @@
 lic 
-enum
+abstract class
  Cli
@@ -499,47 +499,146 @@
 e %7B%0A
+%0A
     
-HTTP_BASIC_AUTHENTICATION_SCHEME %7B%0A
+public static final ClientAuthenticationType HTTP_BASIC_AUTHENTICATION_SCHEME =%0A            new ClientAuthenticationType() %7B%0A        
     
@@ -708,32 +708,40 @@
 der();%0A%0A        
+      
+  
 @Override%0A      
@@ -726,32 +726,40 @@
       @Override%0A
+        
         public v
@@ -814,32 +814,84 @@
 , String apiKey,
+%0A                                                   
  String apiSecre
@@ -903,24 +903,32 @@
             
+        
 if (apiKey !
@@ -950,32 +950,40 @@
 cret != null) %7B%0A
+        
                 
@@ -1050,16 +1050,24 @@
 C + ' '%0A
+        
         
@@ -1230,32 +1230,40 @@
 ));%0A            
+       
+ 
 %7D%0A        %7D%0A    
@@ -1260,36 +1260,152 @@
     
+       
+ 
 %7D%0A    
-%7D,%0A    REQUEST_BODY %7B%0A
+        %7D;%0A%0A    public static final ClientAuthenticationType REQUEST_BODY =%0A            new ClientAuthenticationType() %7B%0A%0A        
     
@@ -1418,32 +1418,40 @@
 verride%0A        
+    
+    
 public void addC
@@ -1498,32 +1498,84 @@
 , String apiKey,
+%0A                                                   
  String apiSecre
@@ -1583,32 +1583,40 @@
 ) %7B%0A            
+     
+   
 request.addParam
@@ -1663,24 +1663,32 @@
             
+        
 if (apiSecre
@@ -1708,32 +1708,40 @@
                 
+     
+   
 request.addParam
@@ -1791,34 +1791,32 @@
 t);%0A            
-%7D%0A
         %7D%0A    %7D;
@@ -1805,24 +1805,50 @@
           %7D%0A
+                %7D%0A        
     %7D;%0A%0A    
@@ -1928,16 +1928,65 @@
  apiKey,
+%0A                                                
  String 

Modify the enum as an abstract type, allowing custom implementations。