MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _get_token

Function _get_token

e2e/python/oidc/oidc_auth_test.py:96–112  ·  view source on GitHub ↗

Get an access token from Keycloak via password grant.

(
    username: str,
    password: str,
    *,
    client_id: str = "openshell-cli",
    scopes: str | None = None,
)

Source from the content-addressed store, hash-verified

94
95
96def _get_token(
97 username: str,
98 password: str,
99 *,
100 client_id: str = "openshell-cli",
101 scopes: str | None = None,
102) -> str:
103 """Get an access token from Keycloak via password grant."""
104 data = {
105 "grant_type": "password",
106 "client_id": client_id,
107 "username": username,
108 "password": password,
109 }
110 if scopes:
111 data["scope"] = scopes
112 return _token_request(data)
113
114
115def _get_ci_token(

Calls 1

_token_requestFunction · 0.85

Tested by

no test coverage detected