403 Forbidden错误,同时访问keycloack中的ClientRepresentation

时间:2016-04-28 08:15:44

标签: http-status-code-403 keycloak

我们在应用程序中使用keycloak API。当我们尝试检索领域的客户端列表时,它会传递403禁止错误。非常感谢您的评论以避免此事。

java.lang.Exception: ErrorStage:CLIENT_REPRESENTATION_ID,HTTP responseCode:403,StatusIno=Forbidden

错过了,

dataArray = [[NSMutableArray alloc] init];
    [dataArray addObject:@"Knowledge"];
    [dataArray addObject:@"Client"];

    float screenWidth = [UIScreen mainScreen].bounds.size.width;
    float pickerWidth = screenWidth * 3 / 4;

    float xPoint = screenWidth / 2 - pickerWidth / 2;

    pickerView = [[UIPickerView alloc] init];
    pickerView.transform = CGAffineTransformMakeScale(1, 1);
    [pickerView setDataSource: self];
    [pickerView setDelegate: self];
    [pickerView setFrame: CGRectMake(xPoint, 200.0f, pickerWidth, 200.0f)];
    pickerView.showsSelectionIndicator = YES;
    [pickerView selectRow:2 inComponent:0 animated:YES];

    UIImageView *imageview = [[UIImageView alloc]
                              initWithFrame:CGRectMake(30, 20, 300, 400)];
    [imageview setImage:[UIImage imageNamed:@"logo.png"]];
    [imageview setContentMode:UIViewContentModeScaleAspectFit];
    [imageview setBackgroundColor: [UIColor whiteColor]];
    [self.view addSubview:imageview];
    [self.view addSubview: pickerView];

1 个答案:

答案 0 :(得分:2)

如果登录用户没有相关的客户端角色访问权限,则可能会收到此错误。将客户端角色访问添加为" View Client"在领域管理下。