Meteor + React : Server side routes? - meteor

I am buidling a meteor app with react. I am using these two packages for a clientside router. kadira:flow-router & kadira:react-layout
But I just realized I have to respond to a post request from paypal. Since this would not be rendering anything this would require a server side route.
How can i answer to a server side route while using a client side router?
Don't tell me I have to build the routing system again.
Thanks

Have you tried meteorhacks:picker? This should do what you're looking for. Here's a link to a tutorial on The Meteor Chef.

Related

How can I change what URL the ASP.NET SPA Proxy directs to once the proxy is online?

In Visual Studio 2022, in the Debug Options there is a way to change the URL that initially loads when you Debug a web application.
However, when using SPA in .net 6.0, the page that initially loads must be the base page, which waits for the SPA Proxy to be online, and then redirects to the SPA Proxy port to load your app when the proxy is ready.
What I'm wondering is if there's any way to set which page this will redirect to, similar to how before using a SPA proxy I could set the debug launch URL to be different from the base / page.
The bundler I am using is Vite, and I have tried using the vite server "open" option to select a URL to open when the server launches. Unfortunately since this is separate from asp.net's proxy logic, they both open. The whole point is I'm trying to avoid loading the base / page.
I have tried modifying the .csproj file so that the SpaProxyServerUrl doesn't just have a port but has a full url, aka from <SpaProxyServerUrl>https://localhost:44466</SpaProxyServerUrl> to <SpaProxyServerUrl>https://localhost:44466/Developer</SpaProxyServerUrl>, but when I do this the spa proxy doesn't launch at all, and the index.html file doesn't load (which is configured in Program.cs with app.MapFallbackToFile("index.html");
Is there a setting I'm missing somewhere? Or does anyone have any ideas on how I can accomplish this? Thank you.
In case anyone else is having the same problem in the future, I was able to get it to work. Strangely for some reason the spa proxy wouldn't let me load my base page (localhost:44366) and load the spa proxy and redirect to localhost:44466/Developer.
However, it worked when both sides were configured to use the same endpoint.
So I changed the debug launch settings to load localhost:44366/Developer and also changed the .csproj's SpaProxyServerUrl to localhost:44466/Developer and then it worked.
No clue why it's setup this way but this change worked for me with .net 6

How do I communicate with a SAML 2.0 server so that I can leverage it's authentication?

I need to set up my .Net 5 web app so that it can connect to a SAML 2.0 login server at this internal site: [login.antares.eng.edu].
I am using this library to help me: https://www.itfoxtec.com/IdentitySaml2
I followed the directions on that site and added the required code to my Startup.cs and added an AuthController.cs controller,
but now I am unsure of how to proceed next.
To try and educate myself on how to work with SAML, I loaded up a website at
[starmaps.cosmos.n.edu] that I know uses the same SAML 2.0 login server that I need to use [login.antares.eng.edu].
When I first load the website, starmaps.cosmos.n.edu, it automatically goes to the SAML server at: login.antares.eng.edu
Using the browser developer tools, I can see the following is being sent:
https://login.antares.eng.edu/idp/profile/SAML2/Redirect/SSO?SAMLRequest=aZZAbsIwEEV%2FJwI%2BcUh5pWQgUVBVJNpGhHbRTWWcASwltuaZ9PH3dYBWdNOVrdHc11NnPEbZ1E4MWjqYNby3gBQsFxP2msut2g3VVZzK4SDu96GK81F6He%2F6w1GeVpm82gKLnsGjtmbCsiRl0RKxhaVBkoZCKc2yuNeLs3zTuxaDXKSjJO2%2FsGgRHtFG0lF4IHIoOHcS0VlPidNECVQt15XjztudroGXs%2FtVxtdQaQ%2BKeFk%2BsujWegVH8AnbyRqhAyiCjX6H30rhLVll6xttKm32E9Z6I6xEjcLIBlCQEp25CAHE9tSE4m6zKeLisdywaIYIvkOdW4NtA74E%2F64VPK1XF%2FAd88EiQZU4aawjmyjb8YT0D%2BcekHesfRT52iQS3SeLPpvaoDhu4H6wd02BpuOuWxwH7S%2F0%2F4vlTwY1LQLpmWrML3xOxk21BPFyUdhaq69oVtf2Y%2B5RRhgo%2BTbMk09Psr9fZvoN&RelayState=https%3A%2F%2Fstarmaps.cosmos.n.edu%2FMapperRun%2FPages%2FMain.aspx
I am not exactly sure what is going on, but I need my web app to do the same.
How can I get my web app using the ITfoxtec library to do this?
Thanks!
You need to decorate the controller or action with the [Authorize] attribute to require authentication and automatically start the login sequence.
Like this in the sample:
https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestWebAppCore/Controllers/HomeController.cs#L15
Alternatively, you can add this requirement generally in Startup.cs/Program.cs.

Next js and google analytics not working behind nginx reverse proxy

I run my website on a server that reverse proxies all requests to a nextjs server and google analytics does not work behind this proxy. I followed this implementation and everything works as intended when I run it on my own machine. The only reason that I can think that this doesn't work is because of the reverse proxy. I would like to still be able to implement google analytics via nextjs instead of adding it to the nginx config so that its easier to maintain. How can I make nextjs able to call google analytics when behind a proxy?
After some simple debugging that I somehow forgot to do before hand I figured out the problem, or so I think. I had my G-Tag stored in an ENV var and I found out that you need to build and start the server with the ENV vars already set before running it. Previously I had, Built -> Added the ENV vars -> Started the server. This was NOT a problem with nginx or google analytics, or really even nextjs.

Blazor WASM: Multiple client apps

I'm working on a Blazor WASM app and I want to add an Administration. The administration will use a completely different set of css and js files so I want to create a new client application for it.
What I'm trying to achieve is to have my app on address https://myapp.com and the admin part on http://myapp.com/admin.
I'm following the example provided in this response https://github.com/dotnet/aspnetcore/issues/21872 but it doesn't work so far. The main application loads, but when I try to navigate to the administration I'm getting 404.
Has anyone did it with .net5?
The problem I was facing was caused because I forgot to add a dependency of the second client project into the server project.

Show Visualforce page in an iframe on asp.net page

Can anyone tell me process of embedding Salesforce Visualforce page on ASP.NET page under an iFrame or through any other way, if you have.
SalesForce doesn't support CORS or JSONP. This is deliberate because they want you to use their stuff:
Connected Apps: for communicating with "headless" applications (web services).
Salesforce Canvas: for embedding external applications within a VisualForce page. I am not sure if this works the other way around. Communication (events) between your SalesForce app and your external app is done via JavaScript XHR proxies. I believe this means you may have to modify your existing app to include their JavaScript library.
Both Connected Apps and Canvas apps require security setup and authentication.
I am still trying to figure this out too. The SalesForce Canvas tutorials use applications hosted on Heroku (they acquired Heroku so they push it whenever they can)... although this makes the examples close-ended, it also adds extra steps.
check this out!
there's something called frontdoor.jsp
https://developer.salesforce.com/blogs/developer-relations/2014/03/see-your-visualforce-pages-on-tv-with-chromecast.html

Resources