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

Cant create or update a okta_app_oauth with token_endpoint_auth_method of "none" #580

Closed
mcrobbj opened this issue Aug 13, 2021 · 14 comments · Fixed by #1091
Closed

Cant create or update a okta_app_oauth with token_endpoint_auth_method of "none" #580

mcrobbj opened this issue Aug 13, 2021 · 14 comments · Fixed by #1091
Assignees
Labels
upstream Issue is upstream in this order okta-sdk-golang, Okta public API, Okta service

Comments

@mcrobbj
Copy link

mcrobbj commented Aug 13, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform 1.0.3
okta prrovider: 3.1..1.

Affected Resource(s)

  • okta_app_oauth

Terraform Configuration Files

resource "okta_app_oauth" "WebApp" {
  label                      = format("%s-%s", var.choices_prefix, "web")
  type                       = "web"
  grant_types                = ["authorization_code"] #, "implicit", "client_credentials"
  redirect_uris              = ["https://localhost", "https://www.thunderclient.io/oauth/callback"]
  response_types             = ["code"] # , "token","id_token"
  **token_endpoint_auth_method = "none"**
  consent_method             = "REQUIRED"
  omit_secret                = true
}

Debug Output

Panic Output

Expected Behavior

It should create the app with a token endpoint auth method of none

Actual Behavior

failed to update OAuth application: The API returned an error: Api validation failed: token_endpoint_auth_method. Causes: errorSummary: token_endpoint_auth_method: 'token_endpoint_auth_method' is invalid. Valid values: [client_secret_basic, client_secret_post, client_secret_jwt, private_key_jwt]

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@bogdanprodan-okta bogdanprodan-okta added the upstream Issue is upstream in this order okta-sdk-golang, Okta public API, Okta service label Aug 13, 2021
@bogdanprodan-okta bogdanprodan-okta self-assigned this Aug 13, 2021
@bogdanprodan-okta
Copy link
Contributor

Hi @mcrobbj! Thanks for submitting this issue! It's clearly a bug from the Okta API itself. According to the official documentation, none is a valid value, so I'll try to request assistance from the team responsible for this functionality.

@monde
Copy link
Collaborator

monde commented Aug 13, 2021

hello @mcrobbj creating a web app which has a client_secret none can’t be used for token_endpoint_auth_method e.g. client_secret_basic, client_secret_post, client_secret_jwt: Use one of these methods when the client has a client secret. Public clients (such as single-page and mobile apps) that can't protect a client secret must use none below.
https://developer.okta.com/docs/reference/api/oidc/#client-authentication-methods

@mcrobbj
Copy link
Author

mcrobbj commented Aug 13, 2021 via email

@monde
Copy link
Collaborator

monde commented Aug 13, 2021

@mcrobbj is this something you can work around? I'll pass this issue along and see what other information I can gather.

@mcrobbj
Copy link
Author

mcrobbj commented Aug 13, 2021 via email

@monde
Copy link
Collaborator

monde commented Aug 13, 2021

@mcrobbj I discussed this with the feature team that does federation and showed them your feedback. This was their response "we have had this check for a long time now, this is not something that changed recently. If the client's grantTypes contains authorization_code, we allow only browser and native clients to create the app with token_endpoint_auth_method=none. We do not have this restriction if the grantType is implicit."

Let me know if there is anything else @bogdanprodan-okta or myself can do for you.

@mcrobbj
Copy link
Author

mcrobbj commented Aug 14, 2021 via email

@bogdanprodan-okta
Copy link
Contributor

Here is the JSON payload that is used to create this app:

{
 "credentials": {
  "oauthClient": {
   "autoKeyRotation": true,
   "token_endpoint_auth_method": "none"
  }
 },
 "label": "testAcc_AUTH",
 "name": "oidc_client",
 "settings": {
  "implicitAssignment": false,
  "oauthClient": {
   "application_type": "web",
   "consent_method": "REQUIRED",
   "grant_types": [
    "authorization_code"
   ],
   "idp_initiated_login": {
    "default_scope": [],
    "mode": "DISABLED"
   },
   "issuer_mode": "ORG_URL",
   "redirect_uris": [
    "https://localhost",
    "https://www.thunderclient.io/oauth/callback"
   ],
   "response_types": [
    "code"
   ],
   "wildcard_redirect": "DISABLED"
  }
 },
 "signOnMode": "OPENID_CONNECT",
 "visibility": {
  "autoSubmitToolbar": false,
  "hide": {
   "iOS": true,
   "web": true
  }
 }
}

And it's clear that grant_types contains authorization_code

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

@bellis-ai
Copy link

so... Is this just left broken or something? Literally impossible to create an SPA App integration with this if I can't select "none" when setting an auth code flow.

The official documentation explicitly says to set this to none.
https://registry.terraform.io/providers/okta/okta/latest/docs/resources/app_oauth#token_endpoint_auth_method

token_endpoint_auth_method - (Optional) Requested authentication method for the token endpoint. It can be set to "none", "client_secret_post", "client_secret_basic", "client_secret_jwt", "private_key_jwt". To enable PKCE, set this to "none".

@bellis-ai
Copy link

so... Is this just left broken or something? Literally impossible to create an SPA App integration with this if I can't select "none" when setting an auth code flow.

The official documentation explicitly says to set this to none. https://registry.terraform.io/providers/okta/okta/latest/docs/resources/app_oauth#token_endpoint_auth_method

token_endpoint_auth_method - (Optional) Requested authentication method for the token endpoint. It can be set to "none", "client_secret_post", "client_secret_basic", "client_secret_jwt", "private_key_jwt". To enable PKCE, set this to "none".

Nvm, looks like you just need to make sure the type is "browser" if you're going to make an SPA. It would help if the values of the "type" variable were made a bit more distinct in the documentation ("browser" vs "web"... really???)

@monde
Copy link
Collaborator

monde commented May 6, 2022

I’ll update the docs, no problem!

@monde monde reopened this May 6, 2022
@monde monde added documentation and removed stale labels May 6, 2022
@monde
Copy link
Collaborator

monde commented May 6, 2022

https://developer.okta.com/docs/reference/api/apps/#add-oauth-2-0-client-application

Parameter Description DataType
application_type The type of client application web, native, browser, or service
Application Type Valid Grant Type Requirements
browser authorization_code, implicit  
native authorization_code, implicit, password, refresh_token Must have at least authorization_code
service client_credentials Works with OAuth 2.0 flow (not OpenID Connect)
web authorization_code, implicit, refresh_token Must have at least authorization_code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Issue is upstream in this order okta-sdk-golang, Okta public API, Okta service
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants