Visual Builder

Get Involved. Join the Conversation.

Topic

    Hugo Zandt
    How to make a VBCS login page that uses Oracle Identity...
    Topic posted October 8, 2019 by Hugo ZandtGreen Ribbon: 100+ Points, last edited October 8, 2019, tagged Action Flows, REST, SaaS Integration, Security, Services, Style, UI, Web 
    55 Views, 3 Comments
    Title:
    How to make a VBCS login page that uses Oracle Identity cloud
    Summary:
    How to create a login page in VBCS that uses the default oracle identity cloud service to authenticate users.
    Content:

    Hello,

    Goal

    We would like to create a login page in VBCS that uses the default oracle identity cloud service to authenticate users. We want to customize the look and feel of the login page for only the users of one particular VBCS application.

    Approach

    • We have created the customized login page which contains text fields for username and password and a login button.
    • The login button has an action chain.
    • The userconfig in our app-flow.json is as follows (unaltered default values):

     "userConfig" : {

        "type" : "vb/DefaultSecurityProvider",

        "configuration" : {

          "authentication" : {

            "type" : "oraclecloud"

          }

        },

     

    Problem

    It is unclear to us how to configure an action chain that passes the username and password to the oracle identity cloud service to authenticate a user.

    We do not want to develop the actual authentication logic in VBCS, as was done in: https://cloudcustomerconnect.oracle.com/posts/6bc348535f and https://blogs.oracle.com/shay/conditional-navigation-based-on-queries-in-oracle-visual-builder-cloud-service .

    Question

    How to configure an action chain that passes a username and password to the oracle identity service to authenticate a user.

    Thanks,

    Hugo

     

    Version:
    19.3.1.2.

    Comment

     

    • Shay Shmeltzer

      If I understand correctly you want to call the REST APIs that IDCS exposes to perform an authentication.

      This process is documented here: Using the Authenticate API 

      Specifically for user/pass here:

      https://docs.oracle.com/en/cloud/paas/identity-cloud/rest-api/authusernamepassword.html

      So it looks like you'll need to execute 2 REST calls first a GET and then a POST.

      Here is a blog showing how to call REST end points from VB - https://blogs.oracle.com/shay/working-with-rest-post-and-other-operations-in-visual-builder

      • Vishnu Mishra

        Hi Shay,

        I am not the OP but I am also looking for the same thing. As I see it, there are 3 steps:


        (1) Make a POST request to https://<tenant-name>.identity.oraclecloud.com/oauth2/v1/token and get the access token using the Client ID and Client Secret of my application. (Mentioned in: https://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/idcs/idcs_rest_postman_obe/rest_postman.html)

        (2) Make a GET request to https://<tenant-name>.identity.oraclecloud.com/sso/v1/sdk/authenticate and get the request state by passing the access token in the header. (Mentioned in: https://docs.oracle.com/en/cloud/paas/identity-cloud/rest-api/authusernamepassword.html)

        (3) Make a POST request to https://<tenant-name>.identity.oraclecloud.com/sso/v1/sdk/authenticate and pass the request state along with the credentials of the user that has to be authenticated.

        In VBCS, I can't even perform the first step to get the access token. In Postman, I am supposed to set some variables in the environment which include the Client ID, Client Secret, username & password of a user and then the host. I can't seem to figure out how to perform these steps in VBCS. Where do I set the Client ID and Client Secret while creating a service connection? Setting them in the User/Client/Resource OAuth 2.0 results in 400: Bad Request.

        Regards,
        Vishnu

        • Shay Shmeltzer

          You might want to ask this on the Identity forum - but it looks like they are using the environment variable for OAuth information.

          If you define the service endpoint in VB and in the authentication section choose OAuth 2.0 - you'll get a place to specify the Client ID and Secret - the hostname is the VB server that sends the request.