2014-11-08 53 views
0

我按照本指南http://docs.cloudfoundry.org/adminguide/uaa-user-management.html創建另一個用戶,但意外更新默認管理員的作用域爲第7步中的「EXISTING-PERMISSIONS scim.write」。之後,當我嘗試更新範圍」 ./uaac客戶端更新管理--authorities'命令我得到了以下錯誤:更改雲代工廠默認管理員的作用域

error response: 
{ 
    "error": "access_denied", 
    "error_description": "Invalid token does not contain resource id (clients)" 
} 

有誰知道如何恢復默認管理員的範圍回來?謝謝!

+0

如果您沒有其他管理員用戶,可能會卡住。我想你可以連接到數據庫並手動更新範圍/權限。另一種選擇是重新部署CF,但除非你使用bosh-lite並在本地運行,否則這可能不是一種選擇。 – 2014-11-18 22:09:51

+0

謝謝!幸運的是,我可以重新部署CF,它可以解決問題 – Gilbert 2014-12-09 02:02:36

回答

0

來自Pivotal的高級現場工程師。

您可以通過連接到OpsMgr或您的部署清單中的postgres UAAdb槓桿憑據來恢復管理員帳戶的組成員身份。以下是您可以使用所需組的示例腳本。不要擔心重複行,因爲PK約束會阻止它們。更新組後,使用BOSH滾動重新啓動UAA服務器。這需要完成以清除UAA的內存緩存......不幸的是沒有更優雅的方式。希望這可以幫助。

--client.write 
insert into group_membership values ((select id from groups where displayname='clients.write'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 

--clients.admin 
insert into group_membership values ((select id from groups where displayname='clients.admin'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 

--scim.read 
insert into group_membership values ((select id from groups where displayname='scim.read'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 

--scim.write 
insert into group_membership values ((select id from groups where displayname='scim.write'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 

--password.write 
insert into group_membership values ((select id from groups where displayname='password.write'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 

--clients.read 
insert into group_membership values ((select id from groups where displayname='clients.read'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 

--uaa.admin 
insert into group_membership values ((select id from groups where displayname='uaa.admin'), (select id from users where username='admin'), 'USER', 'MEMBER', '2015-01-05', 'uaa'); 
0

該OP必須已經更改管理客戶端的權限,而不是管理員用戶的範圍。這將是要運行的聲明:

update oauth_client_details set authorities = 'uaa.admin,clients.read,clients.write,clients.secret,scim.read,scim.write,clients.admin' where client_id = 'admin'