> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # UpdateOAuthApp # Package: headless # Namespace: OAuthAppService # Method link: https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/update-oauth-app.md ## Permission Scopes: Manage OAuth Apps: SCOPE.OAUTH_APP.MANAGE ## Introduction Updates an OAuth app. Only fields provided in `mask.paths` are updated. You can update the following fields: + `name` + `description` + `allowedDomain` + `loginUrl` + `logoutUrl` + `technology` --- ## REST API ### Schema ``` Method: updateOAuthApp Description: Updates an OAuth app. Only fields provided in `mask.paths` are updated. You can update the following fields: + `name` + `description` + `allowedDomain` + `loginUrl` + `logoutUrl` + `technology` URL: https://www.wixapis.com/v1/oauth-apps/{oAuthApp.id} Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: oAuthApp, oAuthApp.id Method parameters: param name: mask | type: mask | description: Explicit list of fields to update. Only fields listed are updated. param name: oAuthApp | type: OAuthApp | description: An intermediary application that authorizes and authenticates an external client to access data on a Wix project or site. | required: true - name: id | type: string | description: GUID of the OAuth app. | required: true - name: name | type: string | description: Display name of the OAuth app, as it appears in the dashboard. - name: description | type: string | description: Description of the OAuth app, as it appears in the dashboard. - name: loginUrl | type: string | description: External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. - name: allowedRedirectUris | type: array | description: List of URIs to which redirection from Wix is allowed after authentication. When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated. Wix only redirects the user if the exact URI is contained in this array. - name: allowedRedirectDomains | type: array | description: List of domains to which redirection from Wix is allowed after processes other than authentication. When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to. Wix only redirects the user if the URL is in one of the specified domains. - name: allowSecretGeneration | type: boolean | description: For internal use only. - name: logoutUrl | type: string | description: External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix. - name: applicationType | type: OAuthAppType | description: OAuth application type. - enum: - OAUTH_APP_TYPE_UNSPECIFIED: OAuth app type is not specified. - WEB_APP: OAuth app type is a web application. - MOBILE: OAuth app type is a mobile application. - OTHER: OAuth app type is some other type of application. - name: technology | type: OAuthTechnologies | description: OAuth technology used by the oauth application. - enum: - OAUTH_TECHNOLOGY_UNSPECIFIED: The OAuth technology is not specified. - JAVASCRIPT: OAuth technology using JavaScript. - ANGULAR: OAuth technology using Angular. - VUE: OAuth technology using Vue.js. - REACT: OAuth technology using React. - REACT_NATIVE: OAuth technology using React Native. - IOS: OAuth technology using iOS. - ANDROID: OAuth technology using Android. - OTHER_TECHNOLOGY: OAuth technology using some other kind of technology. - name: wixPagesDomainsMappings | type: array | description: List of domain mappings from external domains to Wix domains. When a user accesses a non-Wix domain, they can be automatically forwarded to the corresponding Wix domain based on these mappings. This enables domain-level redirection from external domains to Wix-hosted pages. - name: origin | type: string | description: - name: destination | type: string | description: - name: redirectUrlWixPages | type: string | description: Redirect url for Wix-hosted pages. Return type: UpdateOAuthAppResponse - name: oAuthApp | type: OAuthApp | description: Updated OAuth app info. - name: id | type: string | description: GUID of the OAuth app. - name: createdDate | type: string | description: Date and time the OAuth app was created, in ISO 8601 format. - name: name | type: string | description: Display name of the OAuth app, as it appears in the dashboard. - name: description | type: string | description: Description of the OAuth app, as it appears in the dashboard. - name: loginUrl | type: string | description: External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. - name: allowedRedirectUris | type: array | description: List of URIs to which redirection from Wix is allowed after authentication. When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated. Wix only redirects the user if the exact URI is contained in this array. - name: allowedRedirectDomains | type: array | description: List of domains to which redirection from Wix is allowed after processes other than authentication. When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to. Wix only redirects the user if the URL is in one of the specified domains. - name: allowSecretGeneration | type: boolean | description: For internal use only. - name: logoutUrl | type: string | description: External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix. - name: applicationType | type: OAuthAppType | description: OAuth application type. - enum: - OAUTH_APP_TYPE_UNSPECIFIED: OAuth app type is not specified. - WEB_APP: OAuth app type is a web application. - MOBILE: OAuth app type is a mobile application. - OTHER: OAuth app type is some other type of application. - name: technology | type: OAuthTechnologies | description: OAuth technology used by the oauth application. - enum: - OAUTH_TECHNOLOGY_UNSPECIFIED: The OAuth technology is not specified. - JAVASCRIPT: OAuth technology using JavaScript. - ANGULAR: OAuth technology using Angular. - VUE: OAuth technology using Vue.js. - REACT: OAuth technology using React. - REACT_NATIVE: OAuth technology using React Native. - IOS: OAuth technology using iOS. - ANDROID: OAuth technology using Android. - OTHER_TECHNOLOGY: OAuth technology using some other kind of technology. - name: wixPagesDomainsMappings | type: array | description: List of domain mappings from external domains to Wix domains. When a user accesses a non-Wix domain, they can be automatically forwarded to the corresponding Wix domain based on these mappings. This enables domain-level redirection from external domains to Wix-hosted pages. - name: origin | type: string | description: - name: destination | type: string | description: - name: redirectUrlWixPages | type: string | description: Redirect url for Wix-hosted pages. ``` ### Examples ### Update an existing OAuth app ```curl curl -X PATCH \ 'https://www.wixapis.com/oauth-app/v1/oauth-apps/adddb436-aa2c-474a-8f0e-af719f3acd5b' \ -H 'Authorization: \ -H 'Content-Type: application/json' \ -d '{ "oAuthApp": { "allowedRedirectDomains": ["www.my-test-site.com"] }, "mask": { "path": "allowedRedirectDomains" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.headless.OAuthAppService.updateOAuthApp(_id, oAuthApp, mask) Description: Updates an OAuth app. Only fields provided in `mask.paths` are updated. You can update the following fields: + `name` + `description` + `allowedDomain` + `loginUrl` + `logoutUrl` + `technology` # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: oAuthApp, _id, mask Method parameters: param name: _id | type: string | description: GUID of the OAuth app. | required: true param name: mask | type: mask | description: Explicit list of fields to update. Only fields listed are updated. | required: true param name: oAuthApp | type: UpdateOAuthApp | description: An intermediary application that authorizes and authenticates an external client to access data on a Wix project or site. | required: true - name: name | type: string | description: Display name of the OAuth app, as it appears in the dashboard. - name: description | type: string | description: Description of the OAuth app, as it appears in the dashboard. - name: loginUrl | type: string | description: External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. - name: allowedRedirectUris | type: array | description: List of URIs to which redirection from Wix is allowed after authentication. When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated. Wix only redirects the user if the exact URI is contained in this array. - name: allowedRedirectDomains | type: array | description: List of domains to which redirection from Wix is allowed after processes other than authentication. When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to. Wix only redirects the user if the URL is in one of the specified domains. - name: allowSecretGeneration | type: boolean | description: For internal use only. - name: logoutUrl | type: string | description: External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix. - name: applicationType | type: OAuthAppType | description: OAuth application type. - enum: - OAUTH_APP_TYPE_UNSPECIFIED: OAuth app type is not specified. - WEB_APP: OAuth app type is a web application. - MOBILE: OAuth app type is a mobile application. - OTHER: OAuth app type is some other type of application. - name: technology | type: OAuthTechnologies | description: OAuth technology used by the oauth application. - enum: - OAUTH_TECHNOLOGY_UNSPECIFIED: The OAuth technology is not specified. - JAVASCRIPT: OAuth technology using JavaScript. - ANGULAR: OAuth technology using Angular. - VUE: OAuth technology using Vue.js. - REACT: OAuth technology using React. - REACT_NATIVE: OAuth technology using React Native. - IOS: OAuth technology using iOS. - ANDROID: OAuth technology using Android. - OTHER_TECHNOLOGY: OAuth technology using some other kind of technology. - name: wixPagesDomainsMappings | type: array | description: List of domain mappings from external domains to Wix domains. When a user accesses a non-Wix domain, they can be automatically forwarded to the corresponding Wix domain based on these mappings. This enables domain-level redirection from external domains to Wix-hosted pages. - name: origin | type: string | description: - name: destination | type: string | description: - name: redirectUrlWixPages | type: string | description: Redirect url for Wix-hosted pages. Return type: PROMISE - name: _id | type: string | description: GUID of the OAuth app. - name: _createdDate | type: Date | description: Date and time the OAuth app was created, in ISO 8601 format. - name: name | type: string | description: Display name of the OAuth app, as it appears in the dashboard. - name: description | type: string | description: Description of the OAuth app, as it appears in the dashboard. - name: loginUrl | type: string | description: External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. - name: allowedRedirectUris | type: array | description: List of URIs to which redirection from Wix is allowed after authentication. When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated. Wix only redirects the user if the exact URI is contained in this array. - name: allowedRedirectDomains | type: array | description: List of domains to which redirection from Wix is allowed after processes other than authentication. When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to. Wix only redirects the user if the URL is in one of the specified domains. - name: allowSecretGeneration | type: boolean | description: For internal use only. - name: logoutUrl | type: string | description: External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix. - name: applicationType | type: OAuthAppType | description: OAuth application type. - enum: - OAUTH_APP_TYPE_UNSPECIFIED: OAuth app type is not specified. - WEB_APP: OAuth app type is a web application. - MOBILE: OAuth app type is a mobile application. - OTHER: OAuth app type is some other type of application. - name: technology | type: OAuthTechnologies | description: OAuth technology used by the oauth application. - enum: - OAUTH_TECHNOLOGY_UNSPECIFIED: The OAuth technology is not specified. - JAVASCRIPT: OAuth technology using JavaScript. - ANGULAR: OAuth technology using Angular. - VUE: OAuth technology using Vue.js. - REACT: OAuth technology using React. - REACT_NATIVE: OAuth technology using React Native. - IOS: OAuth technology using iOS. - ANDROID: OAuth technology using Android. - OTHER_TECHNOLOGY: OAuth technology using some other kind of technology. - name: wixPagesDomainsMappings | type: array | description: List of domain mappings from external domains to Wix domains. When a user accesses a non-Wix domain, they can be automatically forwarded to the corresponding Wix domain based on these mappings. This enables domain-level redirection from external domains to Wix-hosted pages. - name: origin | type: string | description: - name: destination | type: string | description: - name: redirectUrlWixPages | type: string | description: Redirect url for Wix-hosted pages. ``` ### Examples ### updateOAuthApp ```javascript import { oAuthApps } from '@wix/auth-management'; async function updateOAuthApp(_id,oAuthApp,mask) { const response = await oAuthApps.updateOAuthApp(_id,oAuthApp,mask); }; ``` ### updateOAuthApp (with elevated permissions) ```javascript import { oAuthApps } from '@wix/auth-management'; import { auth } from '@wix/essentials'; async function myUpdateOAuthAppMethod(_id,oAuthApp,mask) { const elevatedUpdateOAuthApp = auth.elevate(oAuthApps.updateOAuthApp); const response = await elevatedUpdateOAuthApp(_id,oAuthApp,mask); } ``` ### updateOAuthApp (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { oAuthApps } from '@wix/auth-management'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { oAuthApps }, // Include the auth strategy and host as relevant }); async function updateOAuthApp(_id,oAuthApp,mask) { const response = await myWixClient.oAuthApps.updateOAuthApp(_id,oAuthApp,mask); }; ``` ---