Enable Dev Hub and Create a Connected App
You need both your Trailhead Playground's username and password to set up automatic authentication with GitLab. To get both, follow the password reset process.
- Click the Setup icon and select Setup.
usersin the Quick Find box, then click Users.
- Select the checkbox next to your name. Make a note of the username; it will be needed later in this project.
- Click Reset Password(s), then OK. A password reset email is sent to the email address associated with your username. Be sure to check your spam folder if you don't see the email.
- Click the link in the email.
- Set and make a note of your Trailhead Playground password. You need it later in this project.
For this project, go ahead and enable Dev Hub in the Trailhead Playground you just set up.
- From Setup, enter
Dev Hubin the Quick Find box and select Dev Hub.
- Click Enable Dev Hub then click Enable Unlocked Packages and Second-Generation Managed Packages.
A connected app is required to build the integration with GitLab. Let’s go ahead and set this up while you have your Trailhead Playground open.
- From Setup, enter
App Managerin the Quick Find box and select App Manager.
- Click New Connected App.
- You work with the DreamHouse app in this project. Let’s update the basic required information.
Connected App Name:
- Contact email: enter your email in this field
- You can leave all other fields in Basic Information blank. (If you like, you can add a fun logo image in the Logo Image URL. We’re partial to Astro.)
- Connected App Name:
- Configure the following for the API (Enable OAuth Settings) section.
- Enable OAuth Settings: checked
Selected OAuth Scopes:
- Access and manage your data (api)
- Perform requests on your behalf at any time (refresh_token, offline_access)
- Provide access to your data via the Web (web)
Require Secret for Web Server Flow: checked
- Click Save, then Continue.
- Make a note of the Consumer Key. You should see it as the first field under the API (Enable OAuth Settings) section. You need this later in the project.
- Next, click Manage then Edit Policies–let’s update admin permissions so the app interacts properly with GitLab.
- In the OAuth Policies section, select Admin approved users are pre-authorized for Permitted Users. If you get a message saying that enabling this option will result in all users currently using this app being denied access, that's okay
because this is a new app and no one has previously used it yet. Go ahead and click OK.
- Click Save to return to the setup page for your connected app.
- To pre-authorize users to use this connected app, scroll down to the Profiles section and click Manage Profiles.
- Select the profiles that are pre-authorized to use this connected app. Add Standard User and System Administrator.
- Click Save.
All right, you’re all set up with your connected app. It’s time to start building the CI/CD pipeline.