使用OAUauthentication设置私人dockerregistry(每个用户使用特定的命名空间)
我的用例需要设置一个私人dockerregistry,能够将用户authentication到特定的名称空间,而防止authentication的用户将图像拉到/推送到其他名字空间,而不是分配给他们的名字空间。
到目前为止,我的调查指出我有以下模块的设置
- dockerregistry(当然)
- Oauth2authentication模块,每个用户的范围
- 在registryconfig.yml文件上设置oauth
这种设置可能吗? 如何configurationdockerregistry以使用OAuth2服务器? 我从官方文档中find了以下资源:
https://docs.docker.com/registry/spec/auth/token/
在我的config.yml中,我添加了以下几行:
auth: token: realm: http://localhost:8200/oauth/token issuer: Auth Service service: Docker Registry rootcertbundle: /certs/server.crt
在位置http://localhost:8200/
是我的QAuth2实现,它基于Spring OAuth2
当我尝试login到我的registry
$> docker login -u admin -p admin https://localhost:5000
似乎没有任何一个QAuth2的stream程被docker跟在后面,我注意到它发送了一个GET(这是不允许的,但我有点破解它通过)请求,并且具有以下forms:
/oauth/token?account=admin&client_id=docker&offline_token=true&service=Docker+Registry
login名和密码在授权头中,Oauth2服务器进行基本的authentication,但没有成功,但是遗漏了grant_type,username,密码等。
我究竟做错了什么?
就我所知道的密码stream而言,正确的OAuth2令牌请求具有以下forms:
curl -X POST "localhost:8200/oauth/token" \ -d "username=admin&password=admin&grant_type=password&scope=read%20write&" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Accept: application/json" \ -H "Authorization: Basic ZG9ja2VyOmRvY2tlcg=="
(在授权标题中的clien_id:client_secret被允许在我的案例docker:docker中在base64中执行特定的密码stream)
有没有OAuth2和docker工作的例子? 我发现以下示例https://github.com/opendns/registry-oauth-server
但这是一个基于Docker文档的自定义OAuth2实现与JWT(纠正我,如果我错了)。
- 如何通过用户名和密码保护在Docker容器中运行的Web应用程序?
- MongDB与Docker身份validation
- 鉴于下面描述的错误,人们如何在Ubuntu / Docker的ASP.NET Core Web API中进行身份validation?
- docker群和使用api密钥的aws ecrauthentication
- 在Docker容器ASP.NET应用程序中集成Windows身份validation
- 与SQL和匿名奇怪的行为Ejabberdauthentication
- DockerHub授权令牌何时到期?
- 如何使用docker与mongo来实现复制和打开身份validation
- jenkins / jenkins中的ssh身份validation:在克隆过程中,docker镜像挂起