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

azurerm_azuread_application - incorrect bearer token being used #1553

Closed
hbuckle opened this issue Jul 12, 2018 · 4 comments
Closed

azurerm_azuread_application - incorrect bearer token being used #1553

hbuckle opened this issue Jul 12, 2018 · 4 comments

Comments

@hbuckle
Copy link
Contributor

hbuckle commented Jul 12, 2018

When using the new azurerm_azuread_application resource with Azure CLI authentication it intermittently fails with the following error

azurerm_azuread_application.azuread_application: graphrbac.ApplicationsClient#Create: Failure responding to request: StatusCode=401 -- Original Error: autorest/azure: Service returned an error. Status=401 Code="Unknown" Message="Unknown service error" Details=[{"odata.error":{"code":"Authentication_MissingOrMalformed","date":"2018-07-12T14:52:03","message":{"lang":"en","value":"Access Token missing or malformed."},"requestId":"7e268721-aa67-42da-97ef-43fb81a2b68e","values":null}}]

On inspecting the logs the bearer token being sent is for management.core.windows.net rather than graph.windows.net.

{
  "aud": "https://management.core.windows.net/",
  "iss": "https://sts.windows.net/xxx/",
  "iat": 1531404067,
  "nbf": 1531404067,
  "exp": 1531407967,
  "acr": "1",
...
}

The accessToken.json file contains several token entries so it appears the wrong one is being used.

@tombuildsstuff
Copy link
Contributor

I believe this'll be fixed by #1544

@tombuildsstuff
Copy link
Contributor

Fixed via #1544

@tombuildsstuff
Copy link
Contributor

hi @hbuckle

Just to let you know that is now available in [v1.10 of the AzureRM Provider(https://github.com/terraform-providers/terraform-provider-azurerm/blob/v1.10.0/CHANGELOG.md#1100-july-21-2018) - which you can update to this version by specifying it in the Provider block, like so:

provider "azurerm" {
  version = "=1.10.0"
}

Thanks!

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants