Skip to content

Commit 4451a49

Browse files
committed
Changes for quickstart
1 parent d1c323b commit 4451a49

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

AppCreationScripts/Configure.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Function ConfigureApplications
226226
# Update config file for 'pythonwebapp'
227227
$configFile = $pwd.Path + "\..\app_config.py"
228228
Write-Host "Updating the sample code ($configFile)"
229-
$dictionary = @{ "tenant-name" = $tenantName;"client-secret-obtained-during-app-registration" = $pythonwebappAppKey;"client-id-as-obtained-during-app-registration" = $pythonwebappAadApplication.AppId };
229+
$dictionary = @{ "Enter_the_Tenant_Name_Here" = $tenantName;"Enter_the_Client_Secret_Here" = $pythonwebappAppKey;"Enter_the_Application_Id_here" = $pythonwebappAadApplication.AppId };
230230
ReplaceInTextFile -configFilePath $configFile -dictionary $dictionary
231231

232232
Add-Content -Value "</tbody></table></body></html>" -Path createdApps.html

AppCreationScripts/sample.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
"SettingFile": "\\..\\app_config.py",
4545
"Mappings": [
4646
{
47-
"key": "tenant-name",
47+
"key": "Enter_the_Tenant_Name_Here",
4848
"value": "$tenantName"
4949
},
5050
{
51-
"key": "client-secret-obtained-during-app-registration",
51+
"key": "Enter_the_Client_Secret_Here",
5252
"value": ".AppKey"
5353
},
5454
{
55-
"key": "client-id-as-obtained-during-app-registration",
55+
"key": "Enter_the_Application_Id_here",
5656
"value": ".AppId"
5757
}
5858
]

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def index():
3636
def authenticate():
3737
# Call to the authorize endpoint
3838
auth_state = str(uuid.uuid4())
39-
session['state'] = auth_state
39+
session[(request.cookies.get("session")+'state')] = auth_state
4040
authorization_url = application.get_authorization_request_url(app_config.SCOPE, state=auth_state,
4141
redirect_uri=app_config.REDIRECT_URI)
4242
resp = flask.Response(status=307)
@@ -49,7 +49,7 @@ def main_logic():
4949
code = flask.request.args['code']
5050
state = flask.request.args['state']
5151
# Raising error if state does not match
52-
if state != session['state']:
52+
if state != session[(request.cookies.get("session")+'state')]:
5353
raise ValueError("State does not match")
5454
result = None
5555
# Checking token cache for accounts

app_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
AUTHORITY = "https://login.microsoftonline.com/tenant-name"
2-
CLIENT_ID = "client-id-as-obtained-during-app-registration"
3-
CLIENT_SECRET = "client-secret-obtained-during-app-registration"
1+
AUTHORITY = "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here"
2+
CLIENT_ID = "Enter_the_Application_Id_here"
3+
CLIENT_SECRET = "Enter_the_Client_Secret_Here"
44
SCOPE = ["https://graph.microsoft.com/User.Read"]
55
REDIRECT_URI = "http://localhost:5000/getAToken"

0 commit comments

Comments
 (0)