laravel aws serverless after login expired 419 - laravel-7

I have Laravel 7 bref deploy to aws serverless.
after login, laravel create 3 session to database session but the result show
419 page expired (SESSION_DRIVER=database).
tried using the SESSION_DRIVER=cookie, but the result is still the same 419 page expired.
What mistake am i doing?

Related

I am getting this error admin.auth.verifyIdToken is not a function using node js and firebase admin sdk

I am getting token from firebase and stored in frontend and then send as a request to node.js and verify the token but before verifying it send error that verify-Id-Token is not a function.

HTTPS HTTP PROBLEM Authorisation Error Error 400: redirect_uri_mismatch

I am Using Oath20 for login and in google API when I was working locally using localhost it was working fine but when I deployed my Api ON
HEROKU it get successfully deployed but when tried to login with google it gives m error
[error what I am getting][1]
My herroku redirects http://help-blog.herokuapp.com/auth/google/callback which is HTTPrequest
but google requires https
[Here google asking for HTTPS but my heroku redirecting to HTTP how to solve this?][2]
I am using my session in this way
[Session code ][3]
please tell how to solve this
[1]: https://i.stack.imgur.com/FCTqW.png
[2]: https://i.stack.imgur.com/ZOyaC.png
[3]: https://i.stack.imgur.com/CktQg.png
When you configured your google login key you also specified a callback url. (screen 2)
This url should be https. i see http in the screen.
Enable https on heroku if its not enabled.

431 request header fields too large - Nuxt auth with Azure active directory federation

I'm trying to add authentication for the nuxt application through IDP federation with azure AD.
basically nuxt auth calls to Azure B2C tenant and it federate to the Azure AD.
The process as follows.
Nuxt Auth -> Azure B2C -> Azure AD (Federated IDP)
Azure AD returns the token as the result of federation.
Azure B2C add that token to the ID token under the key idp_access_token. Then Nuxt auth get the token and use it for authentication.
But after successful login it expect to redirect to the /home page.
redirect: {
login: "/",
callback: "/",
home: "/home"
},
while it redirect it shows the 431 error. The reason for that is large cookie that contains
access token, refresh token
Instead of redirect to the given home page it gives an error like following screenshot shows.
error shows like follows.
is there any way to solve this issue?
I upgraded node version from 12 to 15, deleted browser cache and cookies. But issue is still there.
For 431 error code, we need to change the max size of http request header, use command
--max-http-header-size
and here's an answer related.

How can i persist users on my web application with my Node/Express and Firebase backend

Im currently creating a web application using the react/node/express on top of firebase.
Im confused as to how I should persist my user on the client side.
Currently I have sign up and login routes on my Node/Express server that are working and they each return a JWT which I then save to local storage and then add to each request header as a Bearer token.
The problem is that the JWT token expires after 1 hour and the user has to sign in again.
How can I fix this and persist the user forever(if they choose) along with avoiding saving the JWT in local storage. I was looking over the docs and found this https://firebase.google.com/docs/auth/web/auth-state-persistence but im not sure how i would use that with my node/express server.
Firebase accepts session cookies so you can simply create a cookie or a header on the /login endpoint of the backend and return the user as a response if you don't want a solution which includes local storage:
resp.cookie('Authorization', 'Bearer ' + token, {httpOnly: true, secure: false});
return resp.status(200).send({user, events});

Firebase Admin SDK - Current Logged In User - Nodejs

How do i get currentUser in firebase admin SDK. In client SDK we can use
onAuthStateChanged() or firebase.auth().currentUser()
In NodeJs Server.js file firebase admin SDK onAuthStateChanged() Do not work, what should work here?
Basically i want only logged in users to access my innerPages so i am using express,nodejs app.get method to create routes.
app.get('/', authenticationRequired ,function(req,res){
res.sendFile(path.join(__dirname+'/index.html'));
});
And trying to write authenticationRequired method (returns false or true depending on if user is logged in).
The Firebase Admin SDK does not inherently know what user is using your Express web app. You will need to implement code for this. If you're already using Firebase Authentication in the web app, this takes these steps:
Retrieve the user's ID token on the client
You can get a user's ID token by using the firebase.auth().currentUser.getIdToken() method.
Pass this token from the client to the server
Verify the token on the server
The user ID token can be verified using the admin.auth().verifyIdToken(idToken) method. On success it will return a promise with the decodedToken, otherwise it will return a rejected promise.

Resources