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

Oauth2 Scoped Token isn't working due to invalid scope #936

Closed
nakulrao opened this issue Oct 8, 2024 · 1 comment
Closed

Oauth2 Scoped Token isn't working due to invalid scope #936

nakulrao opened this issue Oct 8, 2024 · 1 comment

Comments

@nakulrao
Copy link

nakulrao commented Oct 8, 2024

Hi there,

I'm having some issues with the Oauth 2.0 Scoped Token authentication. It's complaining that there are invalid scopes however the provider has no parameters to accept scopes as part of the configuration.

Terraform Version

Terraform v1.9.7
on darwin_arm64

Affected Resource(s)

  • use_app_oauth_scoped_token

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

provider "pagerduty" {
  use_app_oauth_scoped_token {
    pd_client_id     = var.pd_client_id
    pd_client_secret = var.pd_client_secret
    pd_subdomain     = var.pd_subdomain
  }
}

Debug Output

https://gist.github.com/nakulrao/0fd63a71714e1d8c704374a306ed673b

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

It should authenticate given that the Scoped OAuth client_id and client_secret are correct. I've tested using the API and am able to authenticate and return an access_token.

Actual Behavior

What actually happened?

failed to prep request: oauth2: "invalid_request" "Invalid scope"

I believe this is because we're not passing in a scope as part of the Authentication flow to PagerDuty

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

@nakulrao nakulrao closed this as completed Oct 8, 2024
@nakulrao
Copy link
Author

nakulrao commented Oct 8, 2024

Turns out it was due to incorrect subdomain

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