<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00008gkzWDCAYOkta Classic EngineSingle Sign-OnAnswered2023-01-28T00:56:18.000Z2023-01-25T19:09:56.000Z2023-01-28T00:56:18.000Z

AaronM.96853 (Customer) asked a question.

Okta Angular single page application auth logic works locally but not on AWS ec2 instance

Locally when I build my angular app, things work. I am prompted with the Okta login screen, I login, and my authn call goes out correctly to Okta, returns a payload, and the application refreshes and I'm authorized.

 

I built the application to AWS, specifying to use my environment.prod.ts which has the updated Okta settings for my AWS server. I don't have any console errors nor do I have any network errors.

 

I visit

 

http://ec2-18-117-10-78.us-east-2.compute.amazonaws.com/

 

And am redirected to the login page:

 

http://ec2-18-117-10-78.us-east-2.compute.amazonaws.com/auth/login

 

Once I login I see the POST call go out to

 

https://dev-00176169.okta.com/api/v1/authn

 

Which does return a 200 with this payload:

 

{

"expiresAt": "2023-01-25T19:10:04.000Z",

"status": "SUCCESS",

"sessionToken": "20111_Mbt4FWvtue0pDE5-dRxlgYk848nArpZn5Q4m7ZmnzN44GmOrc",

"_embedded": {

"user": {

"id": "00u5n5ajfa1GRjab85d6",

"passwordChanged": "2021-02-10T17:45:05.000Z",

"profile": {

"login": "myemail@gmail.com",

"firstName": "John",

"lastName": "Doe",

"locale": "en_US",

"timeZone": "America/Los_Angeles"

}

}

},

"_links": {

"cancel": {

"href": "https://dev-00176169.okta.com/api/v1/authn/cancel",

"hints": {

"allow": ["POST"]

}

}

}

}

 

But my login screen doesn't change. I still have the "Sign In" spinner from Okta and I am not refreshed / redirected to a page within my app. It seems like the payload response from the OKTA API is not being used correctly to set my auth ? But why does it work when I run my app on localhost ?


This question is closed.
Loading
Okta Angular single page application auth logic works locally but not on AWS ec2 instance