How to get Authorization token of AWS Amplify in postman? - aws-amplify

I could able to get Authorization token of AWS amplify by using the following code await Auth.currentSession()).idToken.jwtToken. I am using this in my react native. Now I am creating postman collection for my app and I am not able to generate the Authorization Code in the postman. I didn't find any docs related to it. Can anyone please guide me on how to generate the Authorization Code?

Related

Using Zoho API from within a Blazor WASM app

Im not having any luck whatsoever trying to get my Blazor WASM (client-side) app to obtain an access token from Zoho API.
I am able to obtain an authorization response which contains an "access_token". Unfortunately this token is not working (i believe this is an authorization code?).
Anybody having any success with this?
If you have obtained the access_token then you are part of the way there.
When there are issues after obtaining an access token and attempting to make an API query in a coding language, sometimes trying the API request (with th access_token) using the Curl command line helps to reveal the issue. Zoho usually includes an example Curl command in the API documentation.

Firebase (Flutter) - App Check fails when trying to access resource on Cloud Storage through getDownloadUrl()

I am using getDownloadUrl() to get the download URL for a Cloud Storage resource. Recently, I just enabled AppCheck on my Firebase app, and this download URL is requiring a AppCheck token to access. This behavior makes sense, but I was wondering if there is a built in way to do this? For most Firebase SDKs, the AppCheck token is passed automatically, but there does not seem to be a built in method to get that same automatic behavior with a download URL.
I have a theoretical solution in mind, and this is to pass the AppCheck token as a header in the request for the URL, but there's no documenation on this and I have no idea what header to pass this token in. I am using Flutter, and I am accessing an image resource through a CachedNetworkImage. Any insight in how I could pass AppCheck without using a Firebase SDK would be greatly appreciated.
You're supposed to be able to use getBlob or getBytes but I can't get it to work. CORS fails for me.
https://firebase.google.com/docs/storage/web/download-files#download_data_directly_from_the_sdk

How do I connect my Firebase database to a Google script?

I am trying to put pictures that are on Firebase into a google Drive by using google App script. I've no code, I only tried reading the documentation, but it seems to be deprecated. There seems to be a way to use an Oauth token but I could not find a token on my firebase database.
I go into a lot of detail about using OAuth2 and service accounts with Google Apps Script in this story on Medium.
I suppose you want to use Firebase storage? The approach should be similar:
Create a service account
Use the OAuth2 library to generate a Bearer token
Use that token with the API call via UrlFetchApp
It would help if you shared more details on what you're trying to achieve, but this should set you on the right track.

Getting Firebase Bearer token by simple HttpCall (REST API)

I am currently facing the following situation.
Sending Firebase Messages via HttpCall via the google API endpoint:
https://fcm.googleapis.com/v1/projects/projectName/messages:send
Here we have to use OAuth2.0 with a valid Bearer Token like discussed in this question:
What Bearer token should I be using for Firebase Cloud Messaging testing?
After following these steps I was able to send Firebase Messages via the google API.
Now I would like to get the Bearer Token via a HttpCall without doing the manual step with the Playground https://developers.google.com/oauthplayground.
I cannot find any documentation on how to "Exchange authorization code for tokens" via simple HttpCall. I have no possibility to implement any code because I would like to send Firebase messages inside a "Dataverse Cloud Flow/PowerAutomate", therefore no possibility to load any external DLL (like the Firebase Admin Dll, which would implement this functionality).
I am not,looking for a solution which depends on external Dll like https://firebase.google.com/docs/database/rest/auth#authenticate_with_an_access_token or Pre-RequestScript
Any help is appreciated
What you are after is fundamentally not possible, since you can't hook the result of the bearer token into the same URL process to send messages. By the sounds of it you are unable to fetch one URL, process the results from that URL to pass onto the other which is what the REST API would do.
As such, you will need a secondary service that you can simply send messages to and it will invoke the Message and authentication for you, a bridge as you will. You can use Firebase Cloud Functions with an onRequest call or a simple express server on a Google Compute Engine instance (f1 free tier).
Then you can send your message request from your service to this bridge which will authenticate for you and send the message, it would be a fairly simple script to implement, specially with the admin-sdk.

Is possible to integrate Auth0 to Firebase like this way?

I am building an app in VueJs and I am looking for the best way to do the authentication part, there is an API in progress as well that will need token verification for protected end points.
I would like to know if is possible to integrate Auth0 to Firebase in a way that Firebase is the main center of communication between the VueJs app and Auth0 (the same thing with the API -> Firebase -> Auth0).
I am asking this because I would like to know exactly if I can save some lines of code and performance using Firebase tools to get what I need from Auth0 without connecting directly to Auth0 API. Also I would like to use Fire Store to save the tokens I get from Auth0.
is possible to have this kind of architecture?
Here is a diagram for a better understanding of the wished result, hope is not confusing.
https://ibb.co/68tpw8L
Thank you!
These links are the closest solutions I found thru Google.
But according with the info I found you can do this but using Auth0 as my main gateway but I want all the contrary, using Firebase as the main gateway.
https://firebase.google.com/docs/auth/web/custom-auth#before-you-begin
https://auth0.com/docs/api/authentication#delegation
https://firebase.google.com/docs/web/setup
https://auth0.com/blog/developing-real-time-apps-with-firebase-and-firestore/
Auth0 has deprecated the /delegation endpoint which is used to get the token for third party vender.
https://auth0.com/docs/migrations#api-authorization-with-third-party-vendor-apis
As a workaround, use the firebase custom token authentication mechanism. https://firebase.google.com/docs/auth/admin/create-custom-tokens
https://firebase.google.com/docs/reference/js/firebase.auth.Auth.html#signinwithcustomtoken
To create a custom token, you can use the firebase function if you do not have a backend server.
The entire flow is described in the following auth0 blogs with a complete project.
https://auth0.com/blog/how-to-authenticate-firebase-and-angular-with-auth0-part-1/
https://auth0.com/blog/how-to-authenticate-firebase-and-angular-with-auth0-part-2/

Resources