Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Implementation #41

Open
Jnchi opened this issue Jun 14, 2019 · 0 comments
Open

Python Implementation #41

Jnchi opened this issue Jun 14, 2019 · 0 comments

Comments

@Jnchi
Copy link
Contributor

Jnchi commented Jun 14, 2019

pam_aad.py

import json
import logging
import os
import sys
import adal

with open('/etc/pam_aad.conf', 'r') as f:
    config = json.loads(f.read())

if (config['debug']):
    logging.basicConfig(level=logging.DEBUG)

GRAPH_URL = 'https://graph.microsoft.com'

Source: https://github.com/AzureAD/azure-activedirectory-library-for-python/blob/dev/sample/device_code_sample.py

# Install missing dependency
pip install adal

# Run
sudo python3 pam_aad.py

It can then be called either via pam_exec or openvpn_defer_auth, (See: #39 (comment)).

See: https://github.com/AzureAD/azure-activedirectory-library-for-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant