Maximo

 View Only
Expand all | Collapse all

Connecting Maximo to OAUTH2 EndPoint

  • 1.  Connecting Maximo to OAUTH2 EndPoint

    Posted Sat December 26, 2020 11:05 PM
    Hello Experts,
    I have a requirement to connect Maximo with an HTTP endpoint that uses a token-based authorization method using OAUTH2. Although Maximo does not support OAUTH2 authorization yet, I developed an automation script that generates the API key (using client credentials, client secret) and updates the header in HTTP Endpoint. The solution was working very well until recently the HTTP endpoint is now configured in Google APIGEE. 
    After the change, my current script is unable to generate the API key. 
    I have recently found out that python-requests package (https://pypi.org/project/requests/) lets me generate the API key with new Endpoint. 
    Since this is an additional library not embedded in Maximo, I am looking for a solution to import this package in Maximo EAR and make it available for use in Automation Script.
    My question is how do I import python libraries in the Maximo server and enable it?
    I am using Maximo 7.6.1.1 with a Transportation add-on.

    Thanks
    Kushal Desai
    Technical Architect

    Python HTTP for Humans. Help the Python Software Foundation raise $60,000 USD by December 31st! Building the PSF Q4 Fundraiser
    pypi.org


    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Connecting Maximo to OAUTH2 EndPoint

    Posted Mon December 28, 2020 08:31 AM

    You can import it a couple of ways, but since you're on 7.6.1+ the preferred approach is to copy it to a location where every server can access it (or put it on every server) and then reference that path in the mxe.pylib.path system property which would make it available in every script that needs it. In earlier versions you could manually add it to the path but it required evaluating in each script whether it was already in the path or not and it was pretty hacky because of it. 

    That being said, anything but the most basic python packages doesn't typically work. This is because these have their own dependencies and it becomes a cascading problem (to import this package, you need package X, Y Z, which then need A,B,C). It'll probably be faster to address whatever issue you had managing the OAuth credentials than making this python package work inside of Maximo. 



    ------------------------------
    Steven Shull
    Director of Development
    Projetech Inc
    Cincinnati OH
    ------------------------------