File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 ]
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def index():
3636def 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
Original file line number Diff line number Diff line change 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 "
44SCOPE = ["https://graph.microsoft.com/User.Read" ]
55REDIRECT_URI = "http://localhost:5000/getAToken"
You can’t perform that action at this time.
0 commit comments