diff --git a/README.md b/README.md index fc6d917..a0afbc4 100644 --- a/README.md +++ b/README.md @@ -13,18 +13,19 @@ The Box UI Elements LWC project provides sample code to illustrate wrapping Box 5. Manual create a folder from a given sample record 6. Open the source from this repo in VS Code. 7. Create a [Custom Box App](https://developer.box.com/guides/authentication/client-credentials/) with Client Credentials Auth -8. In Salesforce Setup, go to Custom Metadata Types and create a new record for Box Client Credentials Grant. +8. Share any applicable files/folder access with the Custom Box App's Service Account user found under the General Settings > Service Account Info page of the Custom App +9. In Salesforce Setup, go to Custom Metadata Types and create a new record for Box Client Credentials Grant. For "Box Subject Type" select Enterprise and for the Subject ID use your Box Account's Enterprise ID found on the General Settings tab of your Custom App. > Note: This will use the client id and client secret from the previous step. -9. In VS Code, use the cmd+shift+p shortcut and select SFDX: Authorize Org -10. Confirm you've successfully authorized your org by listing orgs and their associated status: +10. In VS Code, use the cmd+shift+p shortcut and select SFDX: Authorize Org +11. Confirm you've successfully authorized your org by listing orgs and their associated status: ``` sfdx force:org:list ``` -1. List the installed packaged for your org: +List the installed packaged for your org: ``` sfdx force:package:installed:list -u ``` -1. Deploy you project source to either you scratch org or developer org in the next section. +Deploy you project source to either you scratch org or developer org in the next section. ## Deploy to your Org Push to Scratch Org: diff --git a/force-app/main/default/classes/BoxElementsController.cls b/force-app/main/default/classes/BoxElementsController.cls index 98e0d81..75dddc7 100644 --- a/force-app/main/default/classes/BoxElementsController.cls +++ b/force-app/main/default/classes/BoxElementsController.cls @@ -8,7 +8,7 @@ public with sharing class BoxElementsController { - public string ltnOrigin {get{ return URL.getOrgDomainUrl().toExternalForm().split('\\.')[0] + '.develop.lightning.force.com';} set;} + public string ltnOrigin {get{ return URL.getOrgDomainUrl().toExternalForm().replace('my.salesforce', 'lightning.force');} set;} @AuraEnabled(cacheable = true) public static string getVFOrigin() { @@ -39,7 +39,7 @@ public with sharing class BoxElementsController { System.debug('Found boxItemId: ' + boxItemId); System.debug('Found resource type: ' + resourceType); System.debug('Found scopes: ' + scopes); - String ltnOrigin = URL.getOrgDomainUrl().toExternalForm().split('\\.')[0] + '.develop.lightning.force.com'; + String ltnOrigin = URL.getOrgDomainUrl().toExternalForm().replace('my.salesforce', 'lightning.force'); // String ltnOrigin = URL.getOrgDomainUrl().toExternalForm().split('\\.')[0] + '.my.site.com'; System.debug('Ltn origin: ' + ltnOrigin); diff --git a/force-app/main/default/cspTrustedSites/Force.cspTrustedSite-meta copy.xml b/force-app/main/default/cspTrustedSites/Force.cspTrustedSite-meta.xml similarity index 100% rename from force-app/main/default/cspTrustedSites/Force.cspTrustedSite-meta copy.xml rename to force-app/main/default/cspTrustedSites/Force.cspTrustedSite-meta.xml