Skip to content

Commit

Permalink
Add logout redirect for Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed May 25, 2024
1 parent bf2bc54 commit ce01c95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
40 changes: 16 additions & 24 deletions docs/src/apps/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"\n",
"Navigate to **Settings** -> **Apps** and then create another app with the following details\n",
"1. Name: `nesis-prediction-app`\n",
"2. Description: `Nesis admin application`\n",
"2. Description: `Nesis prediction application`\n",
"3. Enabled: `Checked`\n",
"4. Role: Do not select a role\n",
"\n",
Expand All @@ -86,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -100,25 +100,17 @@
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"admin_api_headers = {'Content-Type': 'application/json', 'Authorization': f'Bearer {admin_api_key}'}"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"admin_api_headers = {'Content-Type': 'application/json', 'Authorization': f'Bearer {admin_api_key}'}\n",
"prediction_api_header = {'Content-Type': 'application/json', 'Authorization': f'Bearer {predictions_api_key}'}"
]
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -127,7 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -136,7 +128,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -152,7 +144,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -175,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -202,7 +194,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -218,11 +210,11 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"user_response = requests.post(f'{nesis_api_endpoint}/users', headers=admin_api_headers, json={'email': 'some[email protected]', 'name': 'Da Zone', 'password': 'P@ssword', 'roles': [role['id']]})"
"user_response = requests.post(f'{nesis_api_endpoint}/users', headers=admin_api_headers, json={'email': 'test[email protected]', 'name': 'Da Zone', 'password': 'P@ssword', 'roles': [role['id']]})"
]
},
{
Expand All @@ -245,7 +237,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -263,7 +255,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -272,7 +264,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand All @@ -297,7 +289,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/SessionContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function logoutMicrosoft(config) {
clientId: config?.auth?.OAUTH_AZURE_CLIENT_ID,
authority: config?.auth?.OAUTH_AZURE_AUTHORITY,
redirectUri: config?.auth?.OAUTH_AZURE_REDIRECTURI,
postLogoutRedirectUri: 'http://localhost:3000/',
postLogoutRedirectUri: config?.auth?.OAUTH_AZURE_REDIRECTURI,
},
});
await msalInstance.initialize();
Expand Down

0 comments on commit ce01c95

Please sign in to comment.