use of de.ids_mannheim.korap.authentication.http.HttpAuthorizationHandler in project Kustvakt by KorAP.
the class StringUtilsTest method testBasicHttpSplit.
@Test
public void testBasicHttpSplit() throws KustvaktException {
String s2 = new String(Base64.encodeBase64("test:testPass".getBytes()));
String[] f2 = TransferEncoding.decodeBase64(s2);
assertEquals("test", f2[0]);
assertEquals("testPass", f2[1]);
HttpAuthorizationHandler handler = new HttpAuthorizationHandler();
String s1 = "basic " + new String(Base64.encodeBase64("test:testPass".getBytes()));
AuthorizationData f1 = handler.parseAuthorizationHeaderValue(s1);
assertEquals(s2, f1.getToken());
}
Aggregations