From the Package Manager, I am trying to use the Login Form to connect using OAuth2 to Google and Microsoft. I have entered the client id and secret for each in the configuration, and been to the third party sites and set up things there. When using the Login Form, I correctly navigate to the IDP site to sign in, and receive the code back through the browser url. At the point the POST is being performed to exchange the code for the access token, this is failing with a 'WinHttpSendRequest: 12002: The operation timed out' error.
I have also coded a simple request to test the issue (which fails with the same 12002 error code)
Code: Select all
Mthroutine Name(PostTokenRequest) Access(*PUBLIC)
Define_Com Class(#XPRIM_HttpRequest) Name(#Request)
#Request.Content.AddUrlEncodedFormValue( 'code' '#AuthorizationCode' )
#Request.Content.AddUrlEncodedFormValue( 'client_id' '#COM_SELF.GetOAuth2ClientID' )
#Request.Content.AddUrlEncodedFormValue( 'client_secret' '#COM_SELF.GetOAuth2ClientSecret' )
#Request.Content.AddUrlEncodedFormValue( 'grant_type' 'authorization_code' )
#Request.Content.AddUrlEncodedFormValue( 'redirect_uri' '#COM_SELF.GetOAuth2RedirectUri' )
#Request.DoPost Url('https://www.googleapis.com/oauth2/v4/token')
Define Field(#ResponseText) Type(*NVARCHAR)
#ResponseText := #Request.Response.AsString
EndroutineCode: Select all
{
"error": "invalid_request",
"error_description": "Invalid parameter value for redirect_uri: Missing scheme: #COM_SELF.GetOAuth2RedirectUri"
}If I post to a localhost http from within LANSA the post works correctly.
If I post to the same https url using postman (as shown above), the post from postman works correctly
I have disabled my firewall, dropped off the company VPN, in case they were causing an issue; but to no avail.
Anyone experienced the issue? Any insight on fixing the issue?
I am in the middle of coding a SSO solution to a third party IDP, and am experiencing the same issue there, and with connecting to Azure AD. I am hoping it is likely something simple I have overlooked.