From 201bbf9f479db33749b5fa55f7a69a321d4678f8 Mon Sep 17 00:00:00 2001 From: Rajat Bajaj Date: Fri, 17 Jan 2025 02:38:24 +0530 Subject: [PATCH] Fix oidc_logout, set it to computerd --- internal/auth0/client/resource.go | 1 + internal/auth0/client/resource_test.go | 2 +- .../recordings/TestAccClientOIDCLogout.yaml | 426 ------------------ 3 files changed, 2 insertions(+), 427 deletions(-) delete mode 100644 test/data/recordings/TestAccClientOIDCLogout.yaml diff --git a/internal/auth0/client/resource.go b/internal/auth0/client/resource.go index 9d284f34..93c70279 100644 --- a/internal/auth0/client/resource.go +++ b/internal/auth0/client/resource.go @@ -1330,6 +1330,7 @@ func NewResource() *schema.Resource { "oidc_logout": { Type: schema.TypeList, Optional: true, + Computed: true, MaxItems: 1, Description: "Configure OIDC logout for the Client", Elem: &schema.Resource{ diff --git a/internal/auth0/client/resource_test.go b/internal/auth0/client/resource_test.go index f011821f..1f83fd5d 100644 --- a/internal/auth0/client/resource_test.go +++ b/internal/auth0/client/resource_test.go @@ -2497,7 +2497,7 @@ func TestAccClientOIDCLogout(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - OIDC Logout - %s", t.Name())), resource.TestCheckResourceAttr("auth0_client.my_client", "app_type", "spa"), - resource.TestCheckResourceAttr("auth0_client.my_client", "oidc_logout.#", "0"), + resource.TestCheckResourceAttr("auth0_client.my_client", "oidc_logout.#", "1"), ), }, }, diff --git a/test/data/recordings/TestAccClientOIDCLogout.yaml b/test/data/recordings/TestAccClientOIDCLogout.yaml deleted file mode 100644 index b0f98b1e..00000000 --- a/test/data/recordings/TestAccClientOIDCLogout.yaml +++ /dev/null @@ -1,426 +0,0 @@ ---- -version: 2 -interactions: - - id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 243 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - {"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","app_type":"spa","token_endpoint_auth_method":"none","oidc_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"],"backchannel_logout_initiators":{"mode":"all"}}} - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: false - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"],"backchannel_logout_initiators":{"mode":"all"}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 201 Created - code: 201 - duration: 629.563041ms - - id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"],"backchannel_logout_initiators":{"mode":"all"}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 483.595958ms - - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"],"backchannel_logout_initiators":{"mode":"all"}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 457.486708ms - - id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/all/logout"],"backchannel_logout_initiators":{"mode":"all"}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 466.157792ms - - id: 4 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 299 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - {"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","app_type":"spa","oidc_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"],"backchannel_logout_initiators":{"mode":"custom","selected_initiators":["rp-logout","idp-logout","password-changed","session-expired"]}}} - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: PATCH - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"],"backchannel_logout_initiators":{"mode":"custom","selected_initiators":["rp-logout","idp-logout","password-changed","session-expired"]}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 481.571ms - - id: 5 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"],"backchannel_logout_initiators":{"mode":"custom","selected_initiators":["rp-logout","idp-logout","password-changed","session-expired"]}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 436.509667ms - - id: 6 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"],"backchannel_logout_initiators":{"mode":"custom","selected_initiators":["rp-logout","idp-logout","password-changed","session-expired"]}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 519.649709ms - - id: 7 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000},"oidc_backchannel_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"]},"oidc_logout":{"backchannel_logout_urls":["https://auth0.test/custom/logout"],"backchannel_logout_initiators":{"mode":"custom","selected_initiators":["rp-logout","idp-logout","password-changed","session-expired"]}}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 459.049292ms - - id: 8 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 101 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: | - {"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","app_type":"spa","oidc_logout":{}} - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: PATCH - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 538.028916ms - - id: 9 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 470.716208ms - - id: 10 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: -1 - uncompressed: true - body: '{"name":"Acceptance Test - OIDC Logout - TestAccClientOIDCLogout","client_id":"eDZA9pb390pJRF9EbsFKoevEjOm88554","client_secret":"[REDACTED]","app_type":"spa","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"grant_types":["authorization_code","implicit","refresh_token"],"custom_login_page_on":true,"token_endpoint_auth_method":"none","refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' - headers: - Content-Type: - - application/json; charset=utf-8 - status: 200 OK - code: 200 - duration: 446.979458ms - - id: 11 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - transfer_encoding: [] - trailer: {} - host: terraform-provider-auth0-dev.eu.auth0.com - remote_addr: "" - request_uri: "" - body: "" - form: {} - headers: - Content-Type: - - application/json - User-Agent: - - Go-Auth0/1.11.1 - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/eDZA9pb390pJRF9EbsFKoevEjOm88554 - method: DELETE - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 0 - uncompressed: false - body: "" - headers: - Content-Type: - - application/json; charset=utf-8 - status: 204 No Content - code: 204 - duration: 536.709667ms