Skip to content

Sample code for connecting to RabbitMQ using an OAuth Token aquired from Microsoft Endtra ID using the MSAL library

Notifications You must be signed in to change notification settings

Space-Norway/rabbit_client_sample_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repository contains sample code to authenticate and authorize an external client application to connect to a RabbitMQ message broker using an JWT toke aquired from a Microsoft Entra ID tenant using the Microsoft MSAL Python librabry

Getting Started

Firstly a private key and a certificate to authenticate with Microsoft Entra ID must be created. This certificate must be uploaded to the Microsoft Entra ID.

Create certificate

To generate the private key and certificate run the script generate_certificate.sh and answer the questions. The resulting certificate and private key will be saved to the src/certficate directory

./generate_certificate.sh

Running the code

Configuration is done in the config.yaml file. See this file for a description of the values required. Obtain the required values from an admin of the Microsoft Entra ID tenant.

To install requirements run the following command:

pip install -r requirements.txt

To run the script and connect to RabbitMQ cd to the src directory and run the command

python main.py

About

Sample code for connecting to RabbitMQ using an OAuth Token aquired from Microsoft Endtra ID using the MSAL library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •