Giter Site home page Giter Site logo

roshangautam / microsoft-dynamics-auth Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 13 KB

Microsoft Dynamics 365 authentication plugin for HTTPie.

License: MIT License

Python 100.00%
dynamics-365 crm python httpie http-prompt cli command-line-tool developer-tools

microsoft-dynamics-auth's Introduction

microsoft-dynamics-auth

Microsoft Power Platform auth plugin for HTTPie

Installation

$ pip install microsoft-dynamics-auth

Verify that you see msft-power-platform under --auth-type by running

$ http --help

Configuration

To be able to execute requests you must setup the credentials for the target power platform environment. This auth plugin requires a clientid and secret for an app registerd in Active Directory. You must register an app in Active Directory and add it as an application user in the target power platform environment. Once you have the app configured in both AAD and Power Platform.

Use env-generator.py included in this repository to generate the credentials file .parc in user home directory.

$ python env-generator.py

This will generate a ~/.parc file to store power platform environment credentials. Paste credentials in the following format after the prompt and then press enter")

name: [SECTION_NAME] tenant: [TENANT] key: [CLIENT-ID] secret: [CLIENT-SECRET] resource: [ENVIRONMENT-URL]\n")

For example

name: dev-contoso tenant: contoso.onmicrosoft.com key: highlyconfenditialkey secret: highlyconfidentialsecret resource: https://dev-contoso.crm.dynamics.com")

You can also manually create the ~/.parc in the following format

[default]
tenant = contoso.onmicrosoft.com
key = 52a44848-095e-4882-a880-e8b8083714d8a
secret = highly-confidential-secret
resource = https://dev-contoso.crm.dynamics.com

[dev-contoso1]
tenant = contoso.onmicrosoft.com
key = 52a44848-095e-4882-a880-e8b8083714d8a
secret = highly-confidential-secret
resource = https://dev-contoso1.crm.dynamics.com

[dev-northwind]
tenant = northwind.onmicrosoft.com
key = f4d9f805-a172-4698-9228-518013cd04c5
secret = highly-confidential-secret
resource = https://dev-northwind.crm.dynamics.com

Usage

$ http --auth-type=msft-power-platform --auth='client-key:client-secret' https://your-org-name.your-crm-region.dynamics.com/api/data/v9.0

Use HTTPie sessions

Create session

$ http --session=logged-in --auth-type=msft-dynamics --auth='client-key:client-secret' your-org-name.your-crm-region.dynamics.com

Re-use auth

$ http --session=logged-in POST your-org-name.your-crm-region.dynamics.com hello=world

microsoft-dynamics-auth's People

Contributors

roshangautam avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.