Navigation Menu

Skip to content

Commit

Permalink
updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
user1m committed Feb 16, 2018
1 parent 0d49160 commit 6356d01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
11 changes: 6 additions & 5 deletions README.md
Expand Up @@ -101,19 +101,20 @@ c.MyOAuthenticator.client_secret = 'your-client-secret'


### _Prereqs_:

Requires: **`PyJWT>=1.5.3`**
* Requires: **`PyJWT>=1.5.3`**

```
> pip3 install PyJWT
```

* BE SURE TO SET THE **`AAD_TENANT_ID`** environment variable
* See `run.sh` for an [example](./examples/azuread/)


```
import os
os.environ["AAD_TENANT_ID"] = '{AAD-TENANT-ID}'
# **BE SURE TO SET THE AAD-TENANT-ID ABOVE, HERE! FOR THINGS TO WORK CORRECTLY**
from oauthenticator.azuread import AzureAdOAuthenticator
c.JupyterHub.authenticator_class = AzureAdOAuthenticator
Expand All @@ -125,7 +126,6 @@ c.AzureAdOAuthenticator.oauth_callback_url = 'http://{your-domain}/hub/oauth_cal
c.AzureAdOAuthenticator.client_id = '{AAD-APP-CLIENT-ID}'
c.AzureAdOAuthenticator.client_secret = '{AAD-APP-CLIENT-SECRET}'
c.Spawner.cmd = ['/usr/local/bin/jupyterhub-singleuser']
```

* Run via:
Expand All @@ -134,6 +134,7 @@ c.Spawner.cmd = ['/usr/local/bin/jupyterhub-singleuser']
sudo jupyterhub -f ./path/to/jupyter_config.py –no-ssl –log-level=DEBUG
```


* [Source Code](oauthenticator/azuread.py)


Expand Down
3 changes: 2 additions & 1 deletion examples/azuread/run.sh
@@ -1,2 +1,3 @@
sudo jupyterhub -f ./sample_jupyter_config.py –-no-ssl –-log-level=DEBUG
export AAD_TENANT_ID='{AAD-TENANT-ID}'
jupyterhub -f ./sample_jupyter_config.py –-log-level=DEBUG

5 changes: 0 additions & 5 deletions examples/azuread/sample_jupyter_config.py
@@ -1,7 +1,4 @@
import os
# set AAD TENANT ID here
os.environ["AAD_TENANT_ID"] = '{AAD-TENANT-ID}'

from oauthenticator.azuread import AzureAdOAuthenticator
c.JupyterHub.authenticator_class = AzureAdOAuthenticator

Expand All @@ -12,5 +9,3 @@
c.AzureAdOAuthenticator.oauth_callback_url = 'http://{your-domain}/hub/oauth_callback'
c.AzureAdOAuthenticator.client_id = '{AAD-APP-CLIENT-ID}'
c.AzureAdOAuthenticator.client_secret = '{AAD-APP-CLIENT-SECRET}'

c.Spawner.cmd = ['/usr/local/bin/jupyterhub-singleuser']
4 changes: 1 addition & 3 deletions oauthenticator/azuread.py
Expand Up @@ -96,9 +96,7 @@ def authenticate(self, handler, data=None):
resp = yield http_client.fetch(req)
resp_json = json.loads(resp.body.decode('utf8', 'replace'))

self.log.info(resp_json)

app_log.info("Response %s", resp_json)
# app_log.info("Response %s", resp_json)
access_token = resp_json['access_token']

id_token = resp_json['id_token']
Expand Down

0 comments on commit 6356d01

Please sign in to comment.