Skip to content
Snippets Groups Projects
Verified Commit 2ed9a585 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP auth with base64 encoded string

parent 3a2b66e2
No related branches found
No related tags found
2 merge requests!44Release 0.6,!43Merge f-GRPC-main to dev
Pipeline #9699 passed
package org.caosdb.server.grpc;
import java.util.Base64;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.subject.Subject;
import org.caosdb.server.CaosDBServer;
import org.caosdb.server.ServerProperties;
import org.caosdb.server.accessControl.AnonymousAuthenticationToken;
import org.caosdb.server.accessControl.RealmUsernamePasswordToken;
import org.caosdb.server.accessControl.UserSources;
import io.grpc.Context;
import io.grpc.Contexts;
import io.grpc.Metadata;
......@@ -9,14 +18,6 @@ import io.grpc.ServerCall.Listener;
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;
import io.grpc.Status;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.subject.Subject;
import org.caosdb.server.CaosDBServer;
import org.caosdb.server.ServerProperties;
import org.caosdb.server.accessControl.AnonymousAuthenticationToken;
import org.caosdb.server.accessControl.RealmUsernamePasswordToken;
import org.caosdb.server.accessControl.UserSources;
/**
* ServerInterceptor for Authentication. If the authentication succeeds or if the caller is
......@@ -50,7 +51,7 @@ class AuthInterceptor implements ServerInterceptor {
* subject.
*/
private Subject basicAuth(final String base64) {
final String plain = base64; // TODO =new String(Base64.getDecoder().decode(base64));
final String plain = new String(Base64.getDecoder().decode(base64));
final String[] split = plain.split(":", 2);
final String username = split[0];
final String password = split[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment