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

application: support for setting oauth2_permissions #252

Merged
merged 2 commits into from
May 27, 2020

Conversation

manicminer
Copy link
Member

@manicminer manicminer commented May 18, 2020

Enable setting OAuth 2.0 permission scopes for an AAD application.

If omitted, will be computed from scopes defined out of band.
If specified, will replace any existing scopes configured for an application.
If specified as empty value, will remove any existing scopes from an application.

Thanks to @jorgecarleitao for initial work on #187

Fixes: #73, #162
Replaces: #187

jorgecarleitao and others added 2 commits May 17, 2020 23:49
* Fix up tests
* Ensure back compatibility
* Allow setting zero or more scopes
* Handle default `user_impersonation` scope created by AAD
@katbyte
Copy link
Collaborator

katbyte commented May 24, 2020

@manicminer - would it make sense to include a flag oauth2_permissions_include_default that injects the default permissions? that way you can add your own and not worry about specifying them, as well as clear & reset to the default

@manicminer
Copy link
Member Author

Hi @katbyte, thinking this over a few ways I'm not sure that would work. I can see two options:

  1. Hardcode the default scope in the provider and add it on behalf of the user, which feels like it will break at some point?
  2. Assume a default scope(s) will be created, which it seems to be, but I've had cases where it was not though I'm not sure exactly what configuration causes this. Also, then we'd have to save the state of any default scopes because they are only added at create time?

Just adding my 2c, as an administrator my personal preference is to be explicit about my application scopes.

@manicminer
Copy link
Member Author

Tests pass

Screenshot 2020-05-27 03 09 28

@manicminer manicminer merged commit 6151540 into master May 27, 2020
manicminer added a commit that referenced this pull request May 27, 2020
@manicminer manicminer added this to the v0.10.0 milestone May 27, 2020
@frank-mueller-ps
Copy link

frank-mueller-ps commented May 28, 2020

Is there an expected date for the 0.10.0? Because I need exactly this feature for my current project :)

@manicminer
are you able to answer my question?

@manicminer manicminer deleted the app/oauth2-scopes branch May 31, 2020 00:47
@manicminer
Copy link
Member Author

Hi @imbatman4711, we're planning on releasing this week which will include this change.

@ghost
Copy link

ghost commented Jun 5, 2020

This has been released in version 0.10.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azuread" {
    version = "~> 0.10.0"
}
# ... other configuration ...

@nephinj
Copy link

nephinj commented Jun 23, 2020

Can you provide a sample or better documentation of an empty value? I tried setting oauth2_permissions = [] but it does not seem to work for me and I see values in the manifest.

resource "azuread_application" "Chatbot-adapp" {
name = "${var.prefix}-wapp"
oauth2_permissions = []
oauth2_allow_implicit_flow = false
reply_urls = null
}

@manicminer
Copy link
Member Author

manicminer commented Jun 23, 2020

Hi @nephinj, I'm observing some extreme delays at the moment with changes reflecting in the portal for applications. I've just ran a few tests myself - setting and then deleting oauth2_permissions - and the correct updates are being made (and accepted by the API), but it's been over 10 minutes with updates not yet reflecting.

@ghost
Copy link

ghost commented Jun 26, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 26, 2020
@hashicorp hashicorp unlocked this conversation Jun 27, 2020
@ghost
Copy link

ghost commented Jun 27, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 27, 2020
@hashicorp hashicorp unlocked this conversation Jun 29, 2020
@ghost
Copy link

ghost commented Jul 23, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

Successfully merging this pull request may close these issues.

azuread_application: unexpectedly has an 'exposed API' when viewed in the preview portal
5 participants