Error in default ASP.NET Core with React.js project in Visual Studio with authentication - reactjs

I created an ASP.NET Core with React.js project with individual accounts authentication in VS 2022. When I run it without any changes, I am able to create a user just fine. However when I try and look at fetch data page, when my frontend tries to fetch data from the .NET Core backend, I get an error.
Looking in the network tab, in the response header I see
Bearer error="invalid_token", error_description="The issuer 'https://localhost:44479' is invalid
It's pretty silly that the default project does not work out of the box. I thought it may have to do with some configuration with .AddIdentityServerJwt(), however I can't seem to find many docs on this function. If somebody could explain what this method even does that would be helpful.
Any help would be much appreciated.

Related

Missing files Express API, Sequelize

Hello I’ve been working with Freelance developer for over 10 months developing a Project developer abandon the project one day to the next ghost me disappeared. Send me a file with the work he has done, but I’m missing a backend API
Architecture: (full project is NodeJS in Typescript)
Backend: Express API, Sequelize
Frontend: React 18
My question is there is anyway to recrive the files from the file manager from the server ? Or any other place
Currently, the website is live and working how would I be able to retrieve the files?
I truly appreciate it of anybody has any insight thank you
Unfortunately, the only way to get those missing files is if you or someone you know has access to the server where they are located.
Otherwise, all you can do is look at all frontend API calls to try and reverse-engineer the API based on: the data payload React sends, the URL it hits, the method it uses (GET, POST, etc) and the response it gets from the server currently.
Then you would be left with creating the end-point handlers inside of Express, and the logic for the database such as queries and models. It's a difficult task but you can do it if you look at enough of the other information you have available. Good luck and welcome to Stackoverflow!

Cognos Analytics Rest Api/Api-docs 404 not found issue

I was using Cognos SDK for development purpose, now I am planning to shift to Cognos analytics server rest API.
Following documentation, I tried to frame the URL as http://<cognos_analytics_server:port>/api/api-docs, but I ended in 404 not found.
But when I use /bi/api/api-docs (i.e. http://<cognos_analytics_server:port>/bi/api/api-docs), it's working but I don't find many apis in that swagger.
Can anyone assist me, why is it showing 404? Do I need to do any additional setup for rest API swagger to work?
Also attached how my screen looks when I try to access this request http://<cognos_analytics_server:port>/api/api-docs

Error trying to access /token in web Api

I am trying to host a web Api project with angularjs, with authentication.
It works well on local but when i run it from live it can't find ../token method used for generating token and returns 404 error.
I have tried everything but still no use.
Thanks in advance.

System Security Exception in Silverlight app making GET request

I am new to silverlight. I have been trying to patch up a silverlight app that makes a get request to some site over the net, say google. However, I keep getting the system.security exception again nd again. I read various other posts and what i gathered is that for these things to work u need to choose HOST APPLICATION IN A NEW WEBSITE option while creation of the project, i have done that, but still get the same exception. I downloaded the app from http://www.shinedraw.com/data-handling/flash-vs-silverlight-simple-http-post-request/ and ran it by clicking debug in VS2010, still it gave the same exception.
Please tell me what i am doing wrong, i know its cross domain issues, but dont know what else to do.
The second answer at this post - WebClient.DownloadStringAsync throwing Security Exception in Silverlight, I think, offers a workaround, but does this means there is no way to access such services from silverlight directly?? -
Experienced users please explain.
You cannot call a web service other than from your own domain directly from a Silverlight application. If you want to to this, you would have to install a cross-domain policy on the server that hosts the service. But you can always install a web service within your own web application (that hosts the Sivlerlight app) and call the other service from that service. It's one sercie call more but it works also with services you don't own.

Deploying a Silverlight Application with built-in ASMX WebService to IIS

I've got a Silverlight application which uses a built-in .ASMX WebService to access a SQL database and run some queries. Everything runs without any hitches on my Development machine.
I'm trying to deploy the application to IIS 6 and I'm having some issues.
The Silverlight application itself seems to run fine, however the Web Service does not. I get an unhandled exception error that says [Async_ExceptionOcurred] as soon as the page loads (when the page loads I'm making some Async WebService method calls).
I think this is an issue with the Web Service but I don't know what the problem is. I tried setting the WebService namespace to my URL, but that didn't work. I've tried messing with the SQL connection string in my Web Config but that also affects nothing.
One thing to note is that my IIS Virtual Directory only contains my SilverlightApp.Web folder. I know that the other folder that's part of the application contains a .ClientSettings file for the WebService, but I think this is embedded into the .xap.
Can anyone shed any light on this?
The most likely thing that's happening:
Your webservice proxy on the client is using the address of the web service it was built against: ("http://localhost...").
Things to do:
Use fiddler to confirm this is the issue. It will show you where the proxy is making the call to.
Use the overloaded constructor for the web service and specify a URI. Consider using id/deffing for debug/release. This will overwrite the settings in the client.config.
Create another endpoint in the client config for the release build (Shawn's article here) and select one or the other (again using if/defs).
There are other options as well (looking at the URI and building up the service adress)... but that's the general idea.
hth,
Erik

Resources