Comments (2)
@svianac You can use the ArgoCD CLI with the --sso
option to perform these kind of operation. When calling the argo REST API, Ii expects you to already be authenticated and provide the JWT. If you want to use REST instead of the CLI, I believe you will need to manage the Authentication separately to get a bearer token from your identity provider. You can look at the login command implementation for the actual workflow that you would need to replicate with curl.
Once authenticated, the user will be able to perform the same actions that are performed through the UI with normal RBAC.
Let me know if you need more details before closing the issue.
from argo-cd.
Hello @agaudreault, thanks for the hint. I actually followed your advice and manage to get the cookie using the API and a SSO user. I have DEX+LDAP for authentication. I will share my workflow to get the token:
1 Step
curl -v "https://$ARGOCD_URL/auth/login"
Here we will store a cookie called argocd.oauthstate and a string called session.
2 Step
curl -v "https://$ARGOCD_URL/api/dex/auth/ad?client_id=argo-cd&redirect_uri=https://$ARGOCD_URL/auth/callback&response_type=code&scope=openid+profile+email+groups&state=$STATE1"
Here we will get a new state string.
3 Step
curl -v "https://$ARGOCD_URL/api/dex/auth/ad/login?back=&state=$STATE2" \ --data-raw 'login=yourLDAPuser&password=yourLDAPpassuser'
Here we will get a code
4 Step
Finally we use the code, first state and the cookie from the beginning
curl -v "https://$ARGOCD_URL/auth/callback?code=$CODE&state=$STATE1" \ -H "Cookie: argocd.oauthstate=$COOKIE"
The token will be given in a cookie called argocd.token
Thanks and please feel free to close the ticket.
I just hope the URLs don't change between versions...
from argo-cd.
Related Issues (20)
- errors reported by golangci-lint: S1009: should omit nil check; printf: non-constant format string
- Option to disable swagger-ui endpoint HOT 4
- Different behavior between helm `values` and `valuesObject`
- Invalid redirect uri when using argo-cd dex with workflows
- Specifying namespace for plugin generator in Akuity managed Argo instance HOT 1
- Cannot update self-managed ArgoCD to 2.12 due to race condition between argocd-redis and argocd-application-controller
- Enable compare option "IncludeMutationWebhook" globally HOT 1
- Karpenter webhooks deleted from Argo UI but not API server HOT 2
- Destination permitted check does not check both server and namespace
- Timeout in sync from rest api HOT 1
- If a single cluster fails all other cluster are affected
- Argo is using the wrong DNS name to look up redis server in HA deployment
- Cannot verify CA certificate when creating App with private Gitlab repository but repository is marked in UI as correctly connected
- UI goes haywire when you create a new project, with a previously created project still syncing HOT 1
- Short Commit SHA produces an error after first refresh
- Getting started install assumes an HA config when installing on a multinode cluster
- argocd app get --show-params doesn't show params if Application kind uses multiple sources HOT 1
- RequestedScopes must be set for SSO with PKCE
- Upgrading to v2.12.x causes charts to sync back and forth between older versions
- `ARGOCD_APP_NAMESPACE` isn't always set in `discover.find.command`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argo-cd.