NextJS Amplify Rewrite Incorrect User Agent Header - next.js

After deploying a Next.js app on AWS Amplify and using a rewrite to an external server, when inspecting the request headers, the User Agent header is Amazon CloudFront instead of the user's user agent.
When deploying the same Next.js app on Vercel, the user agent reflects the actual user's user agent, which is the expected behaviour.
Does anyone know how to fix this issue on AWS Amplify?

Related

Firebase Hosting Changes All HTTP Verbs For GET

I'm using GCP cloud run to manage a nodeJS/express API, I did a redirecction from a custom domain to url from cloud run with firebase hosting, when I do a POST request to cloud run domain everything works ok, but when I do the same POST request to my custom domain through firebase hosting the request is redirected as GET. Is there any additional configuration to setup?
I expect to firebase doesnt change HTTP verb

There is a problem with the server configuration. Check the server logs for more information

I used google as an auth provider with next auth. Configured all the the environment variables both in production and development. It's working perfectly in dev mode but in production it shows this error whenever i try to sign in.
I deployed the site to vercel and had setup google id, secret and NEXTAUTH_URL variables there.
I tried to setup google secret properly add it into vercel setting and google credential too
just make sure that you have setup the secret enviroment variable in nextauth i.e
secret : process.env.NEXTAUTH_SECRET

Vercel Deployment and Firebase Authentication - Unable to Customise Redirect URL Google Auth Provider Popup

I had a question in regarding to the NextJS app which uses cloud firestore and firebase authentication which is deployed using the vercel deployment and domain is also registered using vercel itself.
Deployment : Vercel
Domain : Vercel
Authentication : Firebase Authentication
Database: Cloud Firestore
Storage: Firebase Storage
I followed this document https://firebase.google.com/docs/auth/web/google-signin#expandable-4 but without firebase hosting and custom domain registration with firebase, I cannnot “Customizing the redirect domain for Google sign-inOn project creation”
Below configuration is not working
firebase config {
authDomain: “customdomain.com”
}
I cannot change the domain to firebase hosting, because then I won”t be able to deploy using vercel.
Is there a way retain my vercel deployment and customise the redirect url while authenticating user.
Firebase console> authentication > firebase console
click the settings tab
settings
then select Authorised domains and add your ustom domain, if you're unsure check the console firebase will usually tell you what domain is supposed to be added there for example mine looked like this
project-banner-eta.vercel.app
this way work for me also
Firebase console> authentication > firebase console click the settings tab
settings
then select add domains
this will pop out a domain box telling you to enter the domain name
copy your domain name and paste it there and click add
that it all. everything should be ok now

Running Firebase web SDK under phantomjs fails to authenticate valid tokens (auth/network-request-failed)

I am trying to use phantomJS to create a pdf of a authenticated part of a Firebase web app.
The set up is as follows
A cloudFunction is triggered when firestore is updated.
The cloudFunction creates a custom token with admin.auth().createCustomToken with the relevant claims.
A url to the hosted firebaseapp app is created, with the token as a query param.
The URL is given to phantomjs to create a pdf of the page.
When the firebase webapp boots, it grabs the token, and uses firebase.auth().signInWithCustomToken
On success it renders the page.
The hosted page works fine, and I can grab the token that the cloudFunction creates, add it to the URL and test it all in chrome with no issue.
However, when running this under phantomJS, the call to admin.auth().createCustomToken fails with
auth/network-request-failed .
A network error (such as timeout, interrupted connection or unreachable host) has occurred.
I have tried the following
Setting '--ignore-ssl-errors=yes', '--ssl-protocol=tlsv1', '--web-security=false' on PhantomJS
Setting Access-Control-Allow-Origin * on the hosting firebase.json rules
Setting a Content-Security-Policy for all the google apis on the hosting firebase.json rules
Does anyone know what would be blocking the google api within phantom?
Could it be the User agent?

authClient isn't working

I can't get FireFeed OR my own app working with auth, I followed the documentation for this. I copied in the rules and added the keys, what gives? Example: http://flx.me/firefeed/
One think to check when using the Firebase Simple Login / authClient feature is whether or not you have configured the proper application domain in your account. Any domains that you'll be using to host your application and making authentication requests from should be configured in the 'Application Domains' section of Forge (get here by putting your Firebase URL in a browser). For your application, your domains should include flx.me.

Resources