Skip to content

Latest commit

 

History

History
304 lines (176 loc) · 11 KB

chapter-6-precursor.md

File metadata and controls

304 lines (176 loc) · 11 KB

Precursor: Login and Accessing with Postman

Overview

Using Adobe AdminConsole to manage an Experience Platform instance, manage Product Profiles, manage users and administrators. Validate if login to Experience Platform UI succeeds.

Learning Objectives

  • Understand AdminConsole capabilities for Experience Platform
  • Setting up an Adobe I/O Integration
  • Create your local websever to host a WeTravel demo site for data streaming (Chapter 9)

Lab Resources

Lab Tasks

  • Setup an integration
  • Authenticate via POSTMan
  • Install the Fenix Web Server with WeTravel

Setup an integration

  1. Create Certificate

    For MacOS & Linux platform

    Open terminal and execute below command:

    openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate_pub.crt

    For Windows Platform

    For Windows users, please make sure you have OpenSSL set up

    • Download an OpenSSL client OpenSSL

    Extract this zip file to the directory C:\libs

    Open Command Line Prompt and execute below commands.

    set OPENSSL_CONF=C:/libs/openssl-1.1.1-win64-mingw/openssl.cnf
    cd C:/libs/openssl-1.1.1-win64-mingw/
    openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate_pub.crt

    You will get a response similar to the following which prompts you to enter some information about yourself:

    Generating a 2048 bit RSA private key
    .................+++
    .......................................+++
    writing new private key to 'private.key'
    -----
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a DN.
    There are quite a few fields but you can leave some blank
    For some fields there will be a default value,
    If you enter '.', the field will be left blank.
    -----
    Country Name (2 letter code) []:
    State or Province Name (full name) []:
    Locality Name (eg, city) []:
    Organization Name (eg, company) []:
    Organizational Unit Name (eg, section) []:
    Common Name (eg, fully qualified host name) []:
    Email Address []:
    

    After entering the information two files will be generated: certificate_pub.crt and private.key. These files can be found in the same directory that you ran the openssl command from.

    Note certificate_pub.crt will expire in 365 days. You can make the period longer by changing the value of days in the openssl command above but rotating credentials periodically is a good security practice.

    The certificate_pub.crt certificate will later be uploaded to the Adobe IO Console for when you create an API key for access to any Adobe I/O API.

    Your private key file named private.key will be used later to sign your JWT token.

    Note: Don't close this terminal window as you will need it later.

  2. Navigate to the Adobe I/O Console and sign in with your Adobe ID.

  3. From this page we want to create a New Integration.

  4. You will then be prompted to Access an API or to Receive near-real-time events. We will be accessing APIs so select Access an API and then Continue.

  5. The drop-down menu on the top right of the screen is where you would switch your organization if your account is tied to multiple. We are selecting Workshop and Data Services under Experience Cloud since we want to access the data services.

  6. After your organization is selected there will be a new prompt at the top. We want a New Integration so make sure that option is selected before clicking Continue

  7. Fill in your Integration Details. Afterwards, click on Select a File to upload your certificate_pub.crt file we generated in the previous section. Click Create Integration to finish up the process

  8. After creating your integration, you will be able to view the details of your integration. After clicking on Retrieve client Secret your screen should look similar to this.

    Copy down the values for {API KEY}, {IMS ORG} which is the Organization ID, and {CLIENT SECRET} as these will be used in the next step.

Authenticate via POSTMan

  1. Start POSTMan

  2. Click the Import button on the top left.

    Select the PlatformSummit.postman_collection.json collection file from this repository.

  3. Next we need to import our environment. Click on the settings logo

    To bring up the Manage Environments dialog.

  4. Then click on Import

  5. Select the PlatformSummit.postman_environment.json file to import the environment.

  6. Now click on the newly imported Platform Summit - Environment.

  7. Fill out the values for:

    • clientID
    • clientSecret
    • OrgID
    • TechAcctID

    that you generated when you created your new integration.

    Fill these out in both the "Initial Valeus" and the "Current Values" field.

    Also fill out the ldap field with your user id (first initial + last name) so you'll be able to uniquely identify the datasets you create.

  8. Copy the contents of the private.key and use it as the value for secret.

    For MacOS & Linux platform

    From the same terminal you ran openssl, execute the following command:

    pbcopy < private.key

    For Windows Platform

    From the same terminal you ran openssl, execute the following command:

    notepad private.key

    Copy the entire key to the keyboard, including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines up to the last -.

  9. Click Update and close the Manage Environments dialog.

  10. Now make sure you select the Platform Summit - Environment from the environments drop down at the top right of POSTMan.

  11. After all this setup you are now ready to generate an JWT and bearer token to interact with Adobe I/O. In order to make this process easier we'll be using an Adobe I/O Runtime action.

    From our newly imported Platform Summit collection, open Pre-Chapter 6 and click on Adobe I/O Runtime: Generate Auth. Then click on the body tab:

    All of that work you did to setup the environment has been put to good use. Each POSTMan call will take advantage of these values.

  12. Now click Send and scroll down to the response section:

    That JSON response includes an access_token which is the Bearer token used to authenticate with Adobe I/O. The POSTMan call will save this value in an environment variable for future use.


Deploying WeTravel webpage to your machine via Fenix webserver

  1. Download the WeTravel website.

  2. Unzip the WeTravel-local.zip file and make note of which directory you extract the content to.

  3. Start the Fenix web server.

  4. Select the Web Servers menu and click New

  5. Use WeTravel as descriptive name.

  6. Click on the folder in the Directory input field. Then navigate the file dialog to the directory you unzipped the WeTravel-local folder, highlight it and click Select.

  7. Click Create.

  8. Click on the Play button to start the server.

  9. Now your WeTravel site should be ready to be browsed.

  10. Navigate to http://127.0.0.1 to test the web server. You should see the following:

  11. Now we need to redirect requests to we-travel.com to our local web server.

    For MacOS users:

    • Open the Terminal program.

    • Run the following command:

          sudo nano /etc/hosts
      
      • You will need to type in your adminstrator password to continue.

      • You're now in the Nano text editor. You should see something that looks like this:

      • Use the arrow keys to navigate the cursor to the line:

          127.0.0.1  localhost
        

      • Add we-travel.com to the end of the line so it looks like:

          127.0.0.1  localhost   we-travel.com
        

      • Once you're done, hold down the control and O keys to save the file, then control and X to exit.

      • Finally you'll need to restart your Mac's DNS responder by entering the following command into the Terminal:

          sudo killall -HUP mDNSResponder
        

    For Windows users:

    • Press the Windows key.

    • Type Code in the search field to find the Code Editor you downloaded (I.e. VS Code).

    • In the search results, right-click Code and select Run as Administrator. From Code, open the following file:

        c:\Windows\System32\Drivers\etc\hosts
      
    • Add a new line to the end of the file that looks like this:

        127.0.0.1   we-travel.com
      
    • Click File > Save to save your changes.

  12. Navigate to http://we-travel.com to test the web server. You should see the following:


Chapter Wrap

Whew! We are finally ready to start calling the Adobe Experience Platform API's for real. We've run through creating an integration and getting authenticated.

Additional Resources

Authentication Documentation on Adobe I/O


Navigate

Previous: Next:
Chapter 5 - UI - Segmentation: Building Segments from Unified Profiles Chapter 6 - API - Schema: Explore and Define XDM Schema

Return Home: Workbook Index