Use machine auth when using cs3 backend in proxy service

This commit is contained in:
Ishank Arora
2021-10-18 09:54:22 +02:00
parent 35905f4a09
commit 26ec5f0a40
2 changed files with 3 additions and 7 deletions
+2 -7
View File
@@ -31,14 +31,9 @@ func NewCS3UserBackend(rs settings.RoleService, ap RevaAuthenticator, machineAut
}
func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string, withRoles bool) (*cs3.User, string, error) {
// We only support authentication via username for now
if claim != "username" {
return nil, "", fmt.Errorf("claim: %s not supported", claim)
}
res, err := c.authProvider.Authenticate(ctx, &gateway.AuthenticateRequest{
Type: "bearer",
ClientId: value,
Type: "machine",
ClientId: claim + ":" + value,
ClientSecret: c.machineAuthAPIKey,
})