After turning Ravel into https, post is no longer possible.

Asked 2 years ago, Updated 2 years ago, 71 views

Regarding the subject,

·cloudfront→ALB→EC2

·https~→cloudfront→ALB→EC2
※ Issue https~ with Certificate Manager

After making the changes as shown in , Twitter authentication using post, laravel socialite is no longer possible.

The asset helper function is httpsized in routes/web.php using the following process.

 if(config('app.env')==='production'){
 URL::forceScheme('https');
}

The cause is probably around https,
I think it may be because the #session:Store value in the request ($request) during redirect after post or twitter authentication is different, but I don't know how to solve it.

·Before https

#session:Store {#▼
#id: "XXXXXXXXXXXXXXXXXXXXX"
#name: "XXXXXXXXXXXXXXXXXXXXXXXXXX_session"
# attributes:array:4 [▼]
  "_flash" = > array:2 [▼]
    "old" = > [ ]
    "new" = > [ ]
  ]
  "_token" = > "XXXXXXXXXXXXXXXXXXXXX"
  "url" = > array:1 [▼]
    "intended" = > "http://XXXXXXXXX/XXXXXXX/XXXXXXXXX"
  ]
  "_previous" = > array:1[▼
    "url" = > "http://XXXXXXXXX/XXXXXXX"
  ]
]
# handler:DatabaseSessionHandler {#▶}
# started: true }

·After https conversion

#session:Store {#▼
#id: "XXXXXXXXXXXXXXXXXXXXX"
#name: "XXXXXXXXXXXXXXXXXXXXXXXXXX_session"
# attributes: [
  "_token" = > "XXXXXXXXXXXXXXXXXXXXX"
]
# handler:DatabaseSessionHandler {#▶}
# started: true }

We are having a hard time not being able to solve this problem at all.
I'm sorry, but I'd appreciate it if you could tell me how to solve it.

Environment
· Ravel 5.5
· PHP 7.0
· Appache 2.4
· Amazon Linux AMI Release 2018.03

php aws apache laravel https

2022-09-30 16:48

1 Answers

Try setting the APP_URL in the .env file.
For example, APP_URL=http://localhost=>APP_URL=https://localhost.


2022-09-30 16:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.