Composer Rest Server JWT Authentication Angular 5 - hyperledger-composer

is anyone in here knows how to access the url below using angular 5? I want to access the url and retrieved the response cookies of it. Tried it over and over again but it seems like the cookies is not being retrieved. Thanks in advance.
http://localhost:3000/auth/jwt/callback?query=
I tried using postman and I successfully get the access_token. I have no idea how to do the same in typescript.

Related

Shopify JWT session token expired while making axios request call

I have created an app on laravel and vue.js and for the authentication process, I have used the laravel-shopify package. right now when the Axios call duration is long that time gets a session token expired error. I have already referred this solution but this was not worked for me.
Shopify App-bridge session token is having some issues while working with the vue.js and Axios?
Please check attached documents, please check.
video:- https://drive.google.com/file/d/1US2dzgcPWm6iQcK4SMS4b6q85q9l89Mx/view?usp=sharing
When I have passed many files to Axios, I don't want to get expire token error. Does anyone have a solution for this?

Username and password authentication using URQL/Apollo-GraphQL in SvelteKit

I have a SvelteKit application in which backend is in django-graphene (GraphQL backend). I'm able to send username and password and I am able to get the token from backend. But, how do I setup the token for use in child components. I went through URQL/Apollo-GgraphQL docs but nothing is there to set the token or pass the token.
I tried sending that Token using URQL auth-exchange and also using apollo-graphql client but nothing is working.
If someone has example authentication code working using URQL/GraphQL with SvelteKit then please do share.

My APIs are not working in Postman but works in browser | Laravel for REST | Postman v9.7.0 Native Desktop App

I am developing REST APIs for my project in Laravel 6.*. The problem is that my APIs are working in Postman Chrome Extention and web browser but not in Native Desktop Application.
I'm am serving my laravel app. by using php artisan serve command. the The error which i got in postman console
Note :
I'm not using Bearer Token in this API
After adding header
Since it checks for the csrf tokens,according to me it is not allowing third party to access the api.
According to Screenshot, You are not passing the correct header token while calling API,
Try to add your authorization code in the header tab of postman instead of in authorization.
if still, it's not working in that then share picture of postman and your config for API call
You should share your postman config if you want better help.
I'd say the common culprits are :
Check your Bearer token.
Make sure you have a content-type header set to application/json if you're expecting a JSON.

AJAX request to Laravel backend returns 419 CSRF token mismatch

I'm creating a SPA using NextJS and I have a Laravel backend for my API. To authenticate my SPA I'm using laravel sanctum.
My API is on api.domain.com and my app is on domain.com
I've set these environment variables which are relevant to this issue:
SESSION_DRIVER=cookie
SESSION_DOMAIN=.domain.com
SANCTUM_STATEFUL_DOMAINS="domain.com"
When I log in I make a request to /sanctum/csrf-cookie to get my CSRF cookie, and I can see in my following requests I am sending the X-XSRF-TOKEN header with the value from the cookie.
I'm wondering if anyone else has had a similar issue with CSRF mismatches when using sanctum on different subdomains?
OK what ended up fixing my issue is changing the name of my session cookie to something without an underscore, very weird!

Authenticate rest api generated by hypperledger composer using passport-jwt

I want to authenticate my rest end points generated by composer rest server using passport-jwt. I have user database in mysql. Now, I want to allow access to only those users who are already registered. How can I achieve this?
Edited answer:There is a tutorial done by someone in the Composer community -> https://www.codementor.io/gangachris125/passport-jwt-authentication-for-hyperledger-composer-rest-server-jqfgkoljn . Also see this comment on retrieving the access_token cookie https://github.com/hyperledger/composer/issues/2038#issuecomment-400696304 . Finally, for an example of an app using the passport-jwt strategy - see resources https://medium.com/front-end-hacking/learn-using-jwt-with-passport-authentication-9761539c4314 and Composer info in comments shown https://github.com/hyperledger/composer/issues/2038 on JWT specifically. You use that jwt token to authenticate against the REST server and receive the accessToken cookie for all future REST server requests.

Resources