You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
In order to easily hook into the Stormpath Spring Security integration, simply add a ``WebSecurityConfigurerAdapter`` in the application.
407
+
#if( $spring )
408
+
Then, apply stormpath using ``.apply(stormpath())``.
409
+
#end
410
+
Doing that just sets up all of the default views and hooks the Stormpath ``AuthenticationManager`` into your application.
379
411
380
412
Based on the ``SpringSecurityWebAppConfig`` above, we will permit access to the homepage. Any other paths will fall back
381
413
to the default of being secured - you would be redirected to the Stormpath login page. We are going to further protect
@@ -407,22 +439,36 @@ NOTE: In this example, ``hasAuthority`` is used because Spring Security looks fo
407
439
For this reason, we recommend you use ``hasAuthority``. See `this issue <https://github.com/stormpath/stormpath-sdk-java/issues/325#issuecomment-220923162>`_
408
440
for more information.
409
441
410
-
If the authenticated user is not in the specified group, a ``403`` (forbidden) status will be returned. This will
411
-
automatically redirect to ``/error``, which gets handled by our ``RestrictedErrorController.java``.
442
+
If the authenticated user is not in the specified group, a ``403`` (forbidden) status will be returned.
443
+
444
+
#if( $springboot )
445
+
This will automatically redirect to ``/error``, which gets handled by our ``RestrictedErrorController.java``.
412
446
This returns a nicely formatted Thymeleaf template.
447
+
#elseif( $spring)
448
+
This will automatically redirect to ``/403``, which gets handled by our ``ErrorController.java``.
449
+
This returns a nicely formatted JSP.
450
+
#end
413
451
414
452
With the service defined, we can incorporate it into our controller, ``HelloController.java``:
0 commit comments