Hello 馃憢
I'm looking to get a bit more clarity around the changes which have been implemented in capycli to support the new KeyCloak backend for SW360. I scanned through the project documentation but couldn't find anything which describes the new OAuth flow.
I'd like to move away from the classic long-lived token configuration (the classic -oa -t <token>) in our license clearing automation pipelines, and start exchanging client credentials for short-lived tokens instead. I'd also like to avoid configuring credentials or tokens at the command line, for all the reasons @gernot-h summarized nicely in #238 (comment).
Exchanging client credentials for a token manually is pretty straightforward, but it's not ideal. I'd like for capycli to exchange the credentials for me, to avoid needing to have curl and jq installed.
curl --silent --request POST "https://sw360.siemens.com/kc/realms/sw360/protocol/openid-connect/token" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=${OAUTH_CLIENT_ID}" \
--data-urlencode "client_secret=${OAUTH_CLIENT_SECRET}" \
--data-urlencode "scope=email profile WRITE" | jq -r '.access_token' | tee token.out
capycli -oa -t $(cat token.out) ...
I noticed in #238 that some support was added, introducing the -client_id and -client_secret flags. However, it's not clear how to configure additional scopes.
Thanks!
Hello 馃憢
I'm looking to get a bit more clarity around the changes which have been implemented in capycli to support the new KeyCloak backend for SW360. I scanned through the project documentation but couldn't find anything which describes the new OAuth flow.
I'd like to move away from the classic long-lived token configuration (the classic
-oa -t <token>) in our license clearing automation pipelines, and start exchanging client credentials for short-lived tokens instead. I'd also like to avoid configuring credentials or tokens at the command line, for all the reasons @gernot-h summarized nicely in #238 (comment).Exchanging client credentials for a token manually is pretty straightforward, but it's not ideal. I'd like for capycli to exchange the credentials for me, to avoid needing to have curl and jq installed.
I noticed in #238 that some support was added, introducing the
-client_idand-client_secretflags. However, it's not clear how to configure additional scopes.Thanks!