Create an OAuth application in your Gitlab instance that allows opkssh access.
- Go to the Gitlab Admin page
- Go to Applications, add a new application
- Give it a descriptive name (Users will see this name when they authorize opkssh)
- For the redirect URI's enter:
http://localhost:3000/login-callback http://localhost:10001/login-callback http://localhost:11110/login-callback - Deselect Trusted and Confidential.
- Select the scopes:
openid,profileandemail
Create the application and note the Application ID.
Add the configuration in the config file
providers:
- alias: my-gitlab
issuer: https://my-gitlab-url.com
client_id: <Application ID>
scopes: openid email
access_type: offline
prompt: consent
redirect_uris:
- http://localhost:3000/login-callback
- http://localhost:10001/login-callback
- http://localhost:11110/login-callback
You can then log in using your Gitlab instance via
opkssh login my-gitlab
Add the Gitlab URL and Application ID to the providers file on the server:
https://my-gitlab-url.com <Application ID> 24h
Then add identities to the policy to allow those identities to SSH to the server:
opkssh add root [email protected] https://my-gitlab-url.com