Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to avoid setting hard-coded string for AKS AAD Server #639

Open
datlife opened this issue Jun 15, 2021 · 0 comments
Open

How to avoid setting hard-coded string for AKS AAD Server #639

datlife opened this issue Jun 15, 2021 · 0 comments

Comments

@datlife
Copy link

datlife commented Jun 15, 2021

Hello,

One of our project is to programmatically interact with Azure K8s Service (AKS) using OpenID Connect protocol. One of the requirements in the protocol is to set aud field. Currently, I use 6dae42f8-4368-4678-94ff-3960e28e3630 and it is working. This string is a Service Principal ID of AKS AAD Server shared across all Azure Clusters.

$ az ad sp show --id 6dae42f8-4368-4678-94ff-3960e28e3630
{
  "accountEnabled": "True",
  "addIns": [],
  "alternativeNames": [],
  "appDisplayName": "Azure Kubernetes Service AAD Server",
  ....
    "servicePrincipalNames": [
    "6dae42f8-4368-4678-94ff-3960e28e3630",
    "https://aks-aad-server.azure.com"
  ],
  "servicePrincipalType": "Application",
  "signInAudience": "AzureADMultipleOrgs",
...

However, my concern is that this string might change in the future. Is there any way to programmatically obtain this unique ID from the library? I notice that we currently have https://github.com/Azure/go-autorest/blob/autorest/azure/auth/v0.5.7/autorest/azure/environments.go#L83 , but I could not find one for AKS AAD Server.

Thanks

@datlife datlife changed the title How to avoid seting hard-coded string for AKS AAD Server How to avoid setting hard-coded string for AKS AAD Server Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant