Why when I return back from login to I get an ERROR with the sample app? - msal

This is in regards to the sample: msal-web-sample-0.1.0
I am using tomcat 9 and maven to build and run the msal-web-sample code. It is building fine and running, loading spring, etc. I am able to go out and get a username and passowrd login. However, when it tries to return back to my system (https://localhost:8443/msal4jsample/secure/aad) it just has a bit "ERROR PAGE!" heading with Home Page link going back to the main tomcat page.
In the tomcat runtime it has:
2021-06-29 15:28:06.108 ERROR 6360 --- [io-8443-exec-10] o.s.b.w.servlet.support.ErrorPageFilter : Cannot forward to error page for request [/secure/aad] as the response has already been committed. As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false
Of course, that doesn't apply to my setup.
I see the get in the logs returning back OK and don't see any errors on startup. I am at a loss as to where to go from here. Any thoughts?
Also, is there a non-spring implementation that can be used with java but still using MSAL?
Thanks
Alan

Please share additional information about the error. Do you have trouble regrading AAD? Check your environmental settings (Tomcat) if this isn't the case.

Related

Getting started with Open Liberty: 404

I'm trying to follow the guide here - https://openliberty.io/guides/getting-started.html. I'm on the Building and running the application step. I ran "mvn liberty:run" and Open Liberty started without any errors but when I go to http://localhost:9080/system/properties I get the error below.
Error 404:
com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No
target servlet configured for uri: /system/properties
Any suggestions?
At the end of each guide in the "Nice Work! Where to next?" section, each guide has link:
Raise an issue to share feedback
which I would recommend for these kind of questions as you're likely going to get a quicker response if you open an issue directly against the code you're using.

Service worker Failed to load resource: net::ERR_UNSAFE_REDIRECT

would you please tell me what i did wrong with my service worker installation, i have those errors appear in chrome console (see the image-1).
The script resource is behind a redirect, which is disallowed. service-worker.js:1
Failed to load resource: net::ERR_UNSAFE_REDIRECT https://harampress.com/post/45/service-worker.js
i use Laravel framework in backend if that could help
just to know that my service-worker.js is in the root of the website, works fine on home page no errors on chrome console, but the moment i try to navigate to a post for example, those two errors appears (see image-2).
knowing that i use sw-precache and sw-toolbox, i generate the service worker useing sw-precache with gulp.
image-1
image-2
see the solutions here on github discussion
the message from the discussion in github that actually answered to my problem :
What #wanderview means is that when you do
navigator.serviceWorker.register('/sw.js')
The actual requesting URL is the sw.js located in the root
but when you do
navigator.serviceWorker.register('sw.js')
This is actually a Relative URL so what you actually request might be /post/blah/sw.js and your server might treat it as 404 and do some redirect.

After Successful completion of deployment status in Openshift through Eclipse, 404 error page is shown

After Successful completion of deployment status of my Java EE application (Spring ) in Openshift through Eclipse, 404 error page is shown on launching "http://closerbyapp-closerbyonline.rhcloud.com/closerbyapp" url.
Any help to Sort out this problem is highly appreciated.
Did you actually deploy an application at the closerbyapp context? the root context (/) of your application is working and showing the default index.html page that comes with the java cartridges. You should double-check how/where you put your code, and that you added it to git, and what url it should show up at. Maybe provide some of the code you used or steps that you took to deploy the code so we can help troubleshoot it? Along with any logs for your application that might be helpful.

Upgrade from spring 3.0.4 to 3.2.2 causes 405 get not supported for stylesheet

If I build my application with spring 3.0.4, the stylesheet is downloaded no problem.
If I build it with 3.2.2.release, however, I get a 405 error saying GET is not supported when it tries to get the stylesheet.
No other changes have been made.
I am deploying to Glassfish
Does anyone have any ideas what could cause this?
Does anyone have any ideas what could cause this?
Potentially many things. (My guess would be that some request is being redirected to the wrong place by SpringSecurity.)
But rather than guessing, you would be better off gathering some concrete evidence of what is happening:
In the web browser, figure out exactly what the pattern of requests and responses is. For instance, if there is a redirect happening, find out what it is redirecting too.
On the server side, enable debug logging for your application, the Spring stack, and if necessary Glassfish. This should provide you with more clues as to what is happening.

Spring security login error

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?
you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

Resources