Use machine auth when using cs3 backend in proxy service
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user