Skip to content

Help Needed: Automating Admin User Initialization and Token Storage for Coder on AKS with Init Container #17175

Closed Answered by michvllni
michvllni asked this question in General
Discussion options

You must be logged in to vote

Update: I managed to understand this better and solve the issue.

For anyone having the same issue: if the CODER_FIRST_USER environment variables are set, the admin user will get created when starting the coder server.

What I then did was using this user to login via the login API (api/v2/users/login) to get a session token and use this session token to create my personal access token which I then store in the key vault:

coder server &
sleep 10

# get session token via login API
session_token=$(curl -s -X POST http://127.0.0.1:3000/api/v2/users/login \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{"email": "'"$CODER_FIRST_USER_EMAIL"'","password": "'"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by michvllni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy