• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

how to add login feature

 
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am building a java web app. It will be a blog. I need to add login functionality so that an authorized user can create a blog, and it will prevent an unauthorized user from accessing the blog creation features. How would this be implemented on an Enterprise app? Thanks.
 
Brian Jones Jr.
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also don't have the database setup. So, I also need a temporary way to do this. Thanks.
 
Bartender
Posts: 15741
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typically this is done by middleware in the request processing pipeline of your web application framework. Most web application frameworks have already implemented this middleware. For instance, Spring has the Spring Security project which includes in-memory authentication.

What framework are you using to develop your web application?
 
Brian Jones Jr.
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Typically this is done by middleware in the request processing pipeline of your web application framework. Most web application frameworks have already implemented this middleware. For instance, Spring has the Spring Security project which includes in-memory authentication.

What framework are you using to develop your web application?



Thanks. I don't think I have a framework equivalent to Spring. This is some of my tech stack:

Wildfly 10
Hibernate 5
Postgres 9
Weld
RESTEasy JaxRS
AngularJS 1
Java 8

Can I add only Spring Security to my project?
 
Stephan van Hulst
Bartender
Posts: 15741
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe Wildfly just uses the standard Java EE security mechanisms. You can read more about those here: https://docs.oracle.com/javaee/7/tutorial/partsecurity.htm

I believe chapter 47 will explain how to add users, groups and roles to your application, and chapter 49 will explain how to authorize certain users, groups or roles to access methods in your application.
 
Stephan van Hulst
Bartender
Posts: 15741
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might also want to read these two blog posts:

http://arjan-tijms.omnifaces.org/2012/11/implementing-container-authentication.html
http://arjan-tijms.omnifaces.org/2015/08/activating-jaspic-in-jboss-wildfly.html

Honestly, all of this just enforces my belief that it's much easier to use one web application platform to handle your entire backend, than to stitch all these technologies together.
 
Stephan van Hulst
Bartender
Posts: 15741
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I think that you might actually be able to integrate Spring Security with Wildfly. You should google around for this combination.
 
Brian Jones Jr.
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:I believe Wildfly just uses the standard Java EE security mechanisms. You can read more about those here: https://docs.oracle.com/javaee/7/tutorial/partsecurity.htm

I believe chapter 47 will explain how to add users, groups and roles to your application, and chapter 49 will explain how to authorize certain users, groups or roles to access methods in your application.



Thanks! I heard of this, but I wasn't sure exactly what it did.
 
Bartender
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For additional ideas you could also study the source code of a mature Java blog platform such as http://pebble.sourceforge.net/. It supports multiple blogs as well as multiple contributors per blog.
 
Brian Jones Jr.
Ranch Hand
Posts: 42
2
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:For additional ideas you could also study the source code of a mature Java blog platform such as http://pebble.sourceforge.net/. It supports multiple blogs as well as multiple contributors per blog.



Thanks! That's super helpful.
 
reply
    Bookmark Topic Watch Topic
  • New Topic