Basic auth construction using groovy and apache commons

import org.apache.commons.codec.binary.Base64
...
public static String getAuthentication(String login, String password) {
    String content = Base64.encodeBase64String("$login:$password".bytes)
    return "Basic $content"
}
Advertisements