Code Monkey home page Code Monkey logo

Comments (1)

jshcodes avatar jshcodes commented on May 13, 2024

Workaround

The following solution will provide a valid MSSP token.

Notes:

  • Since the authenticate method is called as part of token refresh, and the member_cid is not passed automatically, your token will not automatically refresh with MSSP permissions. You will need to forcibly reset it.
  • This solution only works using the Uber class at this time.
#Simple example to pull host details for a host within a member CID.
import json
from falconpy import api_complete as FalconSDK

#Create an instance of the class using a credential dictionary that contains our member_cid value
falcon = FalconSDK.APIHarness(creds={
        "client_id": "FALCON_API_ID_HERE",
        "client_secret": "FALCON_API_SECRET_HERE",
        "member_cid": "MEMBER_CID_HERE"
    }
)

#Forcibly authenticate using the command method to call the oAuth2AccessToken OperationID
#Set the result to be our new token
falcon.token = falcon.command('oauth2AccessToken', data=falcon.creds)["body"]["access_token"]

#Pull details from a host within the member CID to prove we're authenticated
host = falcon.command('GetDeviceDetails', ids="HOST_ID_HERE")

#Print the results
print(json.dumps(host, indent=4))

A fix for this issue is planned for release shortly. 🚧

from falconpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.