auth

Execute various authentication and authorization functions.

The auth Op command provides auth functionality within the CLI.

Start by opening the Op CLI:

oplang_cli

To authenticate with a Shoreline cluster use the auth <url> command, where <url> is the location of your Shoreline cluster API:

op>
auth https://acme.us.api.shoreline-acme.io
This command opens a browser window and authenticates with the identity provider configured with your Shoreline environment, e.g., Okta.

After you authenticate, the CLI prompt indicates which Shoreline cluster you've connected to:

op:acme-test-shoreline>

auth import

auth import imports an cluster API URL + JSON Web Token (JWT) combination into your local .ops_auth file.

op>
auth import https://acme.us.api.shoreline-acme.io sjTnbGciOiJSUzI1
Adding Auth... Url: https://acme.us.api.shoreline-acme.io, Token: sjTnbGciOiJSUzI1
Saving config to '/home/gabe/.ops_auth.yaml'

After your .ops_auth is updated you're automatically authenticated and the CLI can be used.

auth list

auth list lists all local credential information in shortened form.

op>
auth list
URL: 'https://acme.us.api.shoreline-acme.io'
    type: 'refresh', customer: 'acme', user: 'gabe@shoreline.io', expiry: Tue Dec  7 10:29:46 PST 2021
  URL: 'https://acme2.test2.api.shoreline.io'
    type: 'refresh', customer: 'acme2', user: 'gabe@shoreline.io', expiry: Tue Dec  7 10:30:48 PST 2021
Current URL: 'https://acme.us.api.shoreline-acme.io'

auth refresh

auth refresh updates current authentication credentials.

op>
auth refresh
Adding Auth... Url: https://acme.us.api.shoreline-acme.io, Token: sjTnbGciOiJSUzI1
Saving config to '/home/gabe/.ops_auth.yaml'

auth sudo

The auth sudo Op command gives you Full Administrator access for the next 60 seconds, which temporarily bypasses all Access Control restrictions.

op>
auth sudo
password>*****
Sudo access enabled.

ops_auth YAML

The .ops_auth.yaml file locally stores all Op auth tokens and their respective Shoreline API endpoints.

By default, it is located in /home/<username>/.ops_auth.yaml.

auth:
  - Token: <token>
    Url: https://acme.us.api.shoreline-acme.io
  - Token: <token>
    Url: https://acme2.us.api.shoreline-acme.io
token: <token>
url: https://acme.us.api.shoreline-acme.io