1. Kevin Bell
  2. PowerServer
  3. Thursday, 4 April 2024 15:15 PM UTC

Our team is working on getting Azure AD applied to our PowerServer application.

 

After successfully getting the access token, we need to call BeginSession. We are getting the throw error.

Code:

I have the app variable setup to use the dynamic session.

 

NOTE: The PowerServer application runs without issue when I turn off the authorization portion and uncheck the dynamic session parms variable for PowerServer.

 

Any suggestion would be greatly appreciated.

 

Kevin Bell Accepted Answer Pending Moderation
  1. Thursday, 4 April 2024 16:50 PM UTC
  2. PowerServer
  3. # 1

First off thanks for the speedy responses! 

Calling is correct. I already had that setup in the global function f_authorization(). Copy and pasted it from the help file. Even add a msgbox to confirm at runtime for testing.

Comment
  1. mike S
  2. Thursday, 4 April 2024 18:25 PM UTC
Are you using the same code to validate the token as you use to generate it? where you geneate the token is where you have to validate it in the PS api
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Thursday, 4 April 2024 15:54 PM UTC
  2. PowerServer
  3. # 2

After successfully getting the access token, we need to call BeginSession.

 

after getting the token, you need to set the token in the application object prior to calling beginsession:

application.SetHttpRequesTheader("Authorization", ls_tokentype + " " + ls_token, true) //Application Set Authorization Header 

Comment
There are no comments made yet.
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Thursday, 4 April 2024 15:51 PM UTC
  2. PowerServer
  3. # 3

Hi Kevin,

 

You mention successfully getting the token, but are you using SetHttpRequestHedaer to register the token with the application?

Please see the example code in this documentation page for more details:

https://docs.appeon.com/pb2022r3/powerscript_reference/BeginSession_func.html

 

Regards,
Francisco

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.