Cookie in response header is not set in browser cookie store - scala

I'm using the scala play framework and graphql. I'm trying to set the cookie on graphql mutation by following this blog - https://sysgears.com/articles/best-practices-for-processing-http-headers-and-cookies-in-a-scala-graphql-api/
I'm able to see the cookie in the response headers in the browser as well as in postman client, but it is not set in the browser cookie store.
Below is the snap of response headers. Am I missing something here ?
Update: Tried on chrome-Version 98.0.4758.102 (Official Build) (64-bit), Firefox 97.0 (64-bit) and Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)

If the HttpOnly flag (optional) is included in the HTTP response header, the cookie cannot be accessed through client side script (again if the browser supports this flag).

Related

Is there any document for creating and testing WSO2 REST API

I have created REST API using WSO2 API manager and published. But when I try out it not working. I did subscribe to app and created token and using https://i.stack.imgur.com/Vrej9.png that token i did tried, but no fruitful result.
I have followed official document. I am working with WSO2-am 3.0.0 version.
Follow the QSG doc.
https://apim.docs.wso2.com/en/latest/getting-started/quick-start-guide/
Note from step 3.3:
If this is the first time you are using the API test console from your
browser, open a new tab and navigate to the https://localhost:8243/
URL.
This will prompt your browser to accept the certificate used by the
API Gateway. This is required because by default the API Gateway uses
a self-signed certificate that is not trusted by web browsers.

CORS issue when running ionic project on android and browser

I am having an ionic 3 project which is accessing remote url. However when i run the project on browser with "ionic serve" or on android emulator/device using "ionic cordova build android" command I am getting this following error :
Fetch API cannot load API URL.
Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access.
I googled and found that this is CORS issue which occurs when one domain tries to access other domain, but the project works properly on other 2 machine on same network.
The database in use is couchDB.
You have to enable specific origins on the server that are allowed the access it.
The Ionic Team has also written a nice summary about CORS related to Ionic: Ionic Cors Documentation
First, check if your external API have SSL protection means it's Https instead of Http. And if it is Https and still you are getting the error then use below plugin instead of fetch() or Angular HttpClient.
https://ionicframework.com/docs/native/http

Null value returned from Furl using Xamarin.Forms, request works in Postmaster

I originally posted this on GitHub but the plugin author asked me to move it to Stack Overflow.
I'm developing a Xamarin.Forms app. I'm trying do get data from a test API I've setup with OAuth authorisation. I can get the data fine from Postmaster, but always get a null when doing the same query from Furl.
Using Flurl 2.7.1 (latest stable from NuGet) and Flurl.Http 2.3.1 (latest stable from NuGet).
The code is below (it's a test site and token, so I don't mind posting the link and token as they'll be deleted soon).
I know it's authorising ok, because if I change the token I get a 401 (which was also happening originally until I removed 'Bearer' from the beginning of the token).
I'm testing from Visual Studio 2017 Android Emulator. HttpClientImplementation has been set to Android, and SSL/TLS implementation is Native TLS 1.2+.
var list = await "https://cloud.squidex.io/api/content/straktest/experiment?"
.WithOAuthBearerToken("eyJhbGciOiJSUzI1NiIsImtpZCI6IjkxRkRENEVCRDYwNjMxNURFREI4MENEMDkzMERFRkZBMjFEREE2NkIiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJrZjNVNjlZR01WM3R1QXpRa3czdi1pSGRwbXMifQ.eyJuYmYiOjE1MjY0MTI2NTksImV4cCI6MTUyOTAwNDY1OSwiaXNzIjoiaHR0cHM6Ly9jbG91ZC5zcXVpZGV4LmlvL2lkZW50aXR5LXNlcnZlciIsImF1ZCI6WyJodHRwczovL2Nsb3VkLnNxdWlkZXguaW8vaWRlbnRpdHktc2VydmVyL3Jlc291cmNlcyIsInNxdWlkZXgtYXBpIl0sImNsaWVudF9pZCI6InN0cmFrdGVzdDp0ZXN0Y2xpZW50Iiwic2NvcGUiOlsic3F1aWRleC1hcGkiXX0.ELkBz-vg_gTnGJ9ODXXE5c1AMeYqPmYKxgfgovir6QTxLPRvKNkGeYbzXC6KjGQ4nUdIFzxxjX8_CPVg5MixgHRqzcBSPjLktbCjhkvXMOkSiUNoqnk8uSXmwm_QNZ1XgWZy3d3DPDdMMjliNh0oRbhipwJc9XkqgNFZKylk3-ijCkocbfCLkSH_z2Nt0ikWvL4Ge2zc4udTfsfs2xR4x1hWlFC-iUucw0Vz1LhUAZjRIc0pXPNQvQdTi9bppZ_chUNaJvEY40dcTd-850Z7TQBgN7utrTLbnWnETzWjL4D_KNWDNEfKknJm-4ir08TevfoL08Vd4DmdCjbeJKR8tg")
.GetAsync();
//also tried with .GetStringAsync();//.GetJsonListAsync();
Am I doing something wrong?
Thanks,
Strak

Jasper : How to keep HTTP header in datasource from Jaspersoft Studio to server?

Consider the following :
I have a PHP web application. This application is protected from any intrusion via a middleware that looks for the correct credentials everytime a call to a route is done. If your are logged in correctly, the page is displayed. If not, you are kicked out. Simple and easy.
Now, this application provides me with links that return JSON. This JSON is generated for the sole purpose of reporting. In Jaspersoft Studio, I created a JSON data adapter and used the provided links as the URL.
But that was not it yet. Since a middleware is checking every link calls in the application, I needed to add an exception for my reports. I decided that passing an encrypted token in the HTTP header was the solution. I then added the option into our data adapter.
It worked like a charm!
Now, to the problem :
Using the information provided on the Jaspersoft website, I exported my Data Adapter to the server. The thing is, the HTTP Header is not considered anymore when calling the data source from the server. Of course, my report does not work anymore. I then tested with a link hosted on another platform and it worked, even without the HTTP header.
So, my question is how do I keep the HTTP header in my datasource from Jaspersoft Studio to the server?
Edit 1: Jaspersoft Studio Version : 6.4.0, JasperSoft Server Version: 6.3.0
Those HTTP options were added in JasperReports 6.3.1. The closest Server version to support those features should be 6.4.0.

JavaScript authentication with c# sdk. What happens on server?

I have made a JS authentication on local server, and it also went fluently on server side. As I understood the sdk cached up with the JS auth and all went well. But When I have uploaded this on server, the IsAuthorized method returned false after the JS auth. Why could that happend? And how does the sdk handle the JS auth?
Check your website url in the facebook app configuration page. Maybe the domain is now different?