Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
2ed9a585
Verified
Commit
2ed9a585
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP auth with base64 encoded string
parent
3a2b66e2
No related branches found
No related tags found
2 merge requests
!44
Release 0.6
,
!43
Merge f-GRPC-main to dev
Pipeline
#9699
passed
3 years ago
Stage: info
Stage: test
Stage: deploy
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/caosdb/server/grpc/AuthInterceptor.java
+10
-9
10 additions, 9 deletions
src/main/java/org/caosdb/server/grpc/AuthInterceptor.java
with
10 additions
and
9 deletions
src/main/java/org/caosdb/server/grpc/AuthInterceptor.java
+
10
−
9
View file @
2ed9a585
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
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment