SlideShare a Scribd company logo
1 of 48
Download to read offline
The hidden gems of Spring Security




            Dessì Massimiliano

   Spring Meeting 27 giugno 2009 Cagliari
Author
    Software Architect and Engineer
        ProNetics / Sourcesense

              Presidente
          JugSardegna Onlus

       Fondatore e coordinatore
 SpringFramework Italian User Group
                 Autore
Spring 2.5 Aspect Oriented Programming
La sicurezza non viene vista dagli utenti
La sicurezza viene percepita quando non c'è
     oppure è ad un livello insufficiente
I dati sono il valore delle applicazioni
E' necessario proteggere i dati




  Non farci le scommesse
In questa presentazione vedremo varie facce
    della sicurezza con SpringSecurity
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                     ✔   Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
REST
             Tutto è una risorsa

       Ogni risorsa ha un identificativo


      Representational State Transfer


Tutte le risorse hanno una interfaccia uniforme
         GET, POST, PUT, DELETE


Hypermedia as the engine of application state


Client-server, Stateless, Cacheable, Layered
REST
 http://www.magic-box.org/services/social/center/13
 JAX-RS RESTeasy @
@Path("services/social")
@Component("socialController")
public class SocialController {

    @GET
    @Path("/{domain}/{id}")
    @Produces("application/xml")
    public Response getEntity(@PathParam("domain") String domain, @PathParam("id") String id) {
        Entity entity = null;
        try {
            entity = getEntityManager().getEntity(domain, id);
        } catch (InvalidEntityException e) {
            String[] args = { id, domain };
            LOG.info("Request an invalid entity with id {} and domain {}", args);
        }
        ResponseBuilder builder = (entity == null) ? Response.noContent() :
                                                     Response.ok(getEntityConverter().convert(entity));
        return builder.build();
    }

    @DELETE
    @Path("/{domain}/{id}")
    public String deleteEntity(@PathParam("domain") String domain, @PathParam("id") String id) {
        getEntityManager().deleteEntity(domain, id);
        return OK;
    }
REST
@POST
@Path("/{domain}/{id}")
@Consumes("application/xml")
public String saveEntity(InputStream is, @PathParam("domain") String domain,
     @PathParam("id") String id){

      String xml = inputStreamToString(is);
     Entity entity = getEntityConverter().unconvert(xml, id, domain);
     getEntityManager().deleteEntity(domain, id);
     getEntityManager().saveEntity(entity);
     return OK;
}

@PUT
@Path("/{domain}/{id}")
@Consumes("application/xml")
public String updateEntity(InputStream is, @PathParam("domain") String domain,
                            @PathParam("id") String id){

      String xml = inputStreamToString(is);
     Entity entity = getEntityConverter().unconvert(xml, id, domain);
     getEntityManager().saveEntity(entity);
     return OK;

..
}

     In Ingresso e in uscita è permesso qualunque tipo , XML, JSON, text/plain,
                        files binari, ModelAndView, String...
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
SpringSecurity

SpringSecurity è il framework per la sicurezza maggiormente
scaricato su sourceforge (250k).
Permette di gestire qualsiasi aspetto della sicurezza di una
webapplication in maniera molto accurata.
Sopratutto agisce in maniera trasparente senza intervenire nel
funzionamento della webapplication.
SpringSecurity
Le chiamate passano attraverso un filtro servlet

   <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
   </filter>
   <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
   </filter-mapping>




che propaga le informazioni di autenticazione al thread di
esecuzione
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
Autenticazione


Processo con cui attraverso le credenziali
viene verificato se l'utente è colui che
dichiara di essere.



<sec:authentication-provider user-service-ref="sffsUserDetailservice">
      <sec:password-encoder hash="sha" />
 </sec:authentication-provider>

<bean id="sffsUserDetailservice" class="it.freshfruits.security.AuthenticationJdbcDaoImpl" >
     <property name="rolePrefix" value="ROLE_"/>
     <property name="dataSource" ref="dataSource"/>
     <property name="usersByUsernameQuery"
          value="SELECT username, password, enabled FROM authentication WHERE username = ?" />
     <property name="authoritiesByUsernameQuery"
          value="SELECT username, authority FROM roles WHERE username = ?" />
</bean>
Autorizzazione

Quali authority possono accedere e a cosa
Autorizzazione

<sec:http>
     <sec:intercept-url pattern="/log*.jsp" filters="none" />
     <sec:intercept-url pattern="*.htm" access="ROLE_USER,ROLE_ANONYMOUS" />
     <sec:intercept-url pattern="*.page" access="ROLE_USER,ROLE_ADMIN" />
     <sec:intercept-url pattern="*.edit" access="ROLE_USER,ROLE_ADMIN" />
     <sec:intercept-url pattern="*.admin" access="ROLE_ADMIN" />
     <sec:form-login login-page="/login.jsp" default-target-url="/"
          login-processing-url="/j_security_check" authentication-failure-url="/loginError.jsp" />
     <sec:logout logout-url="/logout.jsp" logout-success url="/login.jsp" />
     <sec:remember-me />
</sec:http>

<bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased" >
     <property name="decisionVoters">
          <list>
               <bean class="org.springframework.security.vote.RoleVoter" />
               <bean class="org.springframework.security.vote.AuthenticatedVoter" />
          </list>
     </property>
</bean>

<sec:global-method-security access-decision-manager-ref="accessDecisionManager">
     <sec:protect-pointcut expression="execution(* it.freshfruits.domain.entity.*.*(..))"
          access="ROLE_USER,ROLE_ADMIN" />
</sec:global-method-security>
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
Groups
Possiamo utilizzare i gruppi, assegniamo i ruoli ai gruppi e
assegniamo gli utenti a dei gruppi.
In questo modo l'utente al login si ritroverà automaticamente i ruoli
dei gruppi al quale appartiene.
Modifichiamo il detailService da così:

<bean id="sffsUserDetailservice" class="it.freshfruits.security.AuthenticationJdbcDaoImpl" >
     <property name="rolePrefix" value="ROLE_"/>
     <property name="dataSource" ref="dataSource"/>
     <property name="usersByUsernameQuery"
          value="SELECT username, password, enabled FROM authentication WHERE username = ?" />
     <property name="authoritiesByUsernameQuery"
          value="SELECT username, authority FROM roles WHERE username = ?" />
</bean>
Groups

A così:
<bean id="sffsUserDetailservice" class="it.freshfruits.security.AuthenticationJdbcDaoImpl">
         <property name="dataSource" ref="dataSource" />
         <property name="usersByUsernameQuery"
              value="SELECT username, password, enabled
                     FROM authentication WHERE username = ?" />
         <property name="groupAuthoritiesByUsernameQuery"
              value="SELECT g.id, g.group_name, ga.name
                     FROM groups g, group_members gm, authorities ga
                     WHERE gm.username = ? AND g.id = ga.group_id AND g.id = gm.group_id" />
         <property name="enableGroups" value="true"/>
         <property name="enableAuthorities" value="false"/>
</bean>
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
OpenID
                     “Le password sono come le mutande...
                       Non devi farle vedere a nessuno
                         Devi cambiarle con regolarità
                         Non devi prestarle a nessuno”




OpenID è un meccanismo decentralizzato per il single sign on.
La nostra applicazione non contiene più la password, di cui si
occupa un provider OpenID.
Basta fornire l' username del tipo:

                    http://max.myopenid.com
OpenID
L'autenticazione avviene esternamente sul provider openid dove
verrà richiesta la password

    <sec:http>
       <sec:concurrent-session-control max-sessions="1" expired-url="/openidlogin.jsp*"/>
       <sec:intercept-url pattern="/openidlogin.jsp*" filters="none"/>
       <sec:intercept-url pattern="/" access="ROLE_USER" />
       <sec:intercept-url pattern="/**" access="ROLE_USER" />
       <sec:openid-login login-page="/openidlogin.jsp" default-target-url="/" />
    </sec:http>




...
<h3>Please Enter Your OpenID Identity</h3>
<form name="f" action="<c:url value='j_spring_openid_security_check'/>" method="POST">
  <table>
    <tr><td>OpenID Identity:</td><td><input type='text' name='j_username'value=''/></td></tr>
    <tr><td colspan='2'><input name="submit" type="submit"></td></tr>
    <tr><td colspan='2'><input name="reset" type="reset"></td></tr>
  </table>
</form>
</body>
</html>
OpenID

La nostra applicazione a questo punto manterrà solo gli username e gli
specifici ruoli applicativi, possiamo implementarci così il nostro
UserDetailService
public class FreshFruitDetailsService implements UserDetailsService {
      private String defaultRole;
      private DataSource dataSource;
      public UserDetails loadUserByUsername(String username) throws
               UsernameNotFoundException, DataAccessException {

          UsersByUsernameMapping mapping = new UsersByUsernameMapping(dataSource);
          List users = mapping.execute(username);
          return (UserDetails) users.get(0);
      }

...
OpenID

    private class UsersByUsernameMapping extends MappingSqlQuery {

     protected UsersByUsernameMapping(DataSource ds) {
      super(ds,"SELECT username, authority, enabled FROM users WHERE username = ? ;");
       declareParameter(new SqlParameter(Types.VARCHAR));
       compile();
     }

     protected Object mapRow(ResultSet rs, int rownum) throws
                                      SQLException {
         String username = rs.getString(1);
         String password = rs.getString(2);
         boolean enabled = rs.getBoolean(3);
         UserDetails user = new User(username, password, enabled, true, true, true,
              New GrantedAuthority[] { new GrantedAuthorityImpl("HOLDER") });
         return user;
     }
    }

    public void setDatasource(DataSource dataSource) {
       this.dataSource = dataSource;
    }

}
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
OAuth

   “An open protocol to allow secure API authorization in a
     simple and standard method from desktop and web
                         applications.”


Una applicazione ne autorizza un altra ad utilizzare i dati di un
                    suo utente autenticato.
OAuth

http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.4.xsd
http://spring-security-oauth.codehaus.org/2.0
http://spring-security-oauth.codehaus.org/schema/spring-security-oauth-2.0.xsd">

   <oauth:provider consumer-details-service-ref="consumerDetails"
                    token-services-ref="tokenServices"
                    request-token-url="/oauth/request_token"
                    authenticate-token-url="/oauth/authorize"
                    authentication-failed-url="/oauth/confirm_access"
                    access-granted-url="/request_token_authorized.jsp"
                    access-token-url="/oauth/access_token"/>

 <oauth:consumer-details-service id="consumerDetails">
   <oauth:consumer name="Tonr.com" key="tonr-consumer-key"
         secret="SHHHHH!!!!!!!!!!" resourceName="Your Photos"
         resourceDescription="Your photos that you have uploaded to sparklr.com."/>
 </oauth:consumer-details-service>

 <oauth:token-services id="tokenServices"/>
OAuth

“An open protocol to allow secure API authorization in a simple
  and standard method from desktop and web applications.”


Una applicazione ne autorizza un altra ad utilizzare i dati di un
                    suo utente autenticato.
OAuth
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.4.xsd
http://spring-security-oauth.codehaus.org/2.0
http://spring-security-oauth.codehaus.org/schema/spring-security-oauth-2.0.xsd">

   <oauth:provider consumer-details-service-ref="consumerDetails"
                    token-services-ref="tokenServices"
                    request-token-url="/oauth/request_token"
                    authenticate-token-url="/oauth/authorize"
                    authentication-failed-url="/oauth/confirm_access"
                    access-granted-url="/request_token_authorized.jsp"
                    access-token-url="/oauth/access_token"/>

 <oauth:consumer-details-service id="consumerDetails">
   <oauth:consumer name="Tonr.com" key="tonr-consumer-key"
         secret="SHHHHH!!!!!!!!!!" resourceName="Your Photos"
         resourceDescription="Your photos that you have uploaded to sparklr.com."/>
 </oauth:consumer-details-service>

 <oauth:token-services id="tokenServices"/>
OAuth


Oauth for Spring security http://spring-security-oauth.codehaus.org
non è parte della distribuzione di Spring,


               ma funziona senza problemi :)

Se usato con OpenID bisogna tenere conto che OpenID come
Auhtentication usa un OpenIDAuthenticationToken
perciò il servizio autorizzante deve tenerne conto
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
ACL
Una Access Control list permette di gestire i permessi sui singoli
oggetti di dominio, definendo chi può fare cosa su quell' oggetto.

 ObjectIdentity oid = new ObjectIdentityImpl(MyClass.class, 13);
 MutableAcl acl = mutableAclService.createAcl(oid);
 acl.insertAce(0, BasePermission.READ, new GrantedAuthoritySid(role.getName()), true);
 acl.insertAce(1, BasePermission.WRITE, new GrantedAuthoritySid(“ROLE_WRITE”), true);
 acl.insertAce(2, BasePermission.CREATE, new GrantedAuthoritySid(“ROLE_CREATE”), true);
 acl.insertAce(3, BasePermission.DELETE, new GrantedAuthoritySid(“ROLE_DELETE”), true);
 acl.insertAce(4, BasePermission.ADMINISTRATION, new PrincipalSid(“ROLE_ADMIN”), true);
 mutableAclService.updateAcl(acl);



 <bean id="aclService" class="it.pronetics.acl.repository.jdbc.PostgreSqlMutableAclService" >
      <constructor-arg ref="dataSource" />
      <constructor-arg ref="lookupStrategy" />
      <constructor-arg ref="jdbcAclCache" />
      <property name="sidIdentityQuery" value="select currval('acl_sid_id_seq')" />
      <property name="classIdentityQuery" value="select currval('acl_class_id_seq')" />
 </bean>
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
AOP
    <!-- Securing Methods with Security Interceptor -->

<bean class="org.springaop.chapter.five.security.FooServiceImpl">
     <security:intercept-methods access-decision-manager-ref="accessDecisionManager">
         <security:protect method="org.springaop.chapter.five.security.FooService.getBalance"
                   access="ROLE_USER" />
         <security:protect
                   method="org.springaop.chapter.five.security.FooService.setBalanceAccount"
                   access="ROLE_ACCOUNTING,ROLE_ADMIN" />
         <security:protect method="org.springaop.chapter.five.security.FooService.suspendAccount"
                   access="ROLE_ADMIN" />
     </security:intercept-methods>
</bean>

    <!-- Securing Methods with Pointcut-->

<global-method-security access-decision-manager-ref="accessDecisionManager">
   <protect-pointcut
        expression="execution(* org.springaop.chapter.five.security.FooService.getBalance(..))"
        access="ROLE_USER" />
   <protect-pointcut
        expression="execution(* org.springaop.chapter.five.security.FooService.set*(..))"
        access="ROLE_ACCOUNTING,ROLE_ADMIN" />
   <protect-pointcut
        expression="execution(*org.springaop.chapter.five.security.FooService.suspendAccount(..))"
        access="ROLE_ADMIN" />
</global-method-security>
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
Annotations
import org.springframework.security.annotation.Secured;

public class FooServiceImplWithAnnotations implements FooService {

    @Secured("ROLE_USER")
    public Integer getBalance(Integer idAccount) {
        Integer result = 0;
        ...
        return result;
    }

    @Secured( { "ROLE_ACCOUNTING", "ROLE_ADMIN" })
    public void setBalanceAccount(Integer id, Integer balance) {
        ...
    }

    @Secured("ROLE_ADMIN")
    public boolean suspendAccount(Integer id) {
        boolean result = false;
        ...
        return result;
    }
}
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
Spring 3
Oltre alle modifiche REST alla parte MVC, Spring 3 introduce una
importante novita:


               Spring Expression Language (SpEL)


Si tratta di un linguaggio molto espressivo che supporta
l'interrogazione e la modifica di un grafo di oggetti a runtime,
utilizzabile nella configurazione xml, nelle annotazioni nelle firme
dei metodi
Spring 3

                                 Nei bean sull' xml

<bean id="numberGuess" class="org.spring.samples.NumberGuess">
    <property name="randomNumber" value="#{ T(java.lang.Math).random() * 100.0 }"/>

</bean>


<bean id="shapeGuess" class="org.spring.samples.ShapeGuess">
    <property name="initialShapeSeed" value="#{ numberGuess.randomNumber }"/>

</bean>




                        e posso anche riferirli tra loro
Spring 3

                                         Nel codice
public class SimpleMovieLister {

      private MovieFinder movieFinder;
      private String defaultLocale;

      @Value("#{ systemProperties['user.region'] }")
      public void setDefaultLocale(String defaultLocale){
          this.defaultLocale = defaultLocale;
      }

      @Autowired
      public void configure(MovieFinder movieFinder,
                         @Value("#{ systemProperties['user.region'] } String defaultLocale){
             this.movieFinder = movieFinder;
             this.defaultLocale = defaultLocale;
         }
...
}
Agenda
                     ✔       REST
           ✔   SpringSecurity
✔   Authentication/Authorization
                 ✔       Groups
                 ✔       OpenID
                     ✔       OAuth
                         ✔   ACL
                         ✔   AOP
           ✔   @ Annotations
                 ✔       Spring 3
       ✔       SpringSecurity 3
SpringSecurity 3



       Posso quindi usare SpEL negli url da intercettare

<http use-expressions="true">
    <intercept-url pattern="/secure/**" access="hasRole('ROLE_ADMIN') and
        hasIpAddress('192.168.1.0/24')" />
...
</http>
SpringSecurity 3

Posso usare delle @Pre e @Post annotazioni che lavorano
insieme alla ACL e usare anche SpEL

<global-method-security pre-post-annotations="enabled"/>

@PreAuthorize("hasRole('ROLE_ADMIN')")
public void create(Contact contact);

@PreAuthorize("hasPermission(#contact, 'admin')")
public void deletePermission(Contact contact, Sid recipient, Permission permission);

@PreAuthorize("#contact.name == principal.name)")
public void doSomething(Contact contact);
SpringSecurity 3



 Oppure posso usare SpEL per
 filtrare le collezioni in base ai ruoli

@PreAuthorize("hasRole('ROLE_USER')")
@PostFilter("hasPermission(filterObject,'read')or
             hasPermission(filterObject,'admin')")
Public List getAll();
Domande ?
Grazie per l'attenzione !

      Massimiliano Dessì
      desmax74 at yahoo.it
 massimiliano.dessi at pronetics.it
                      http://jroller.com/desmax
                      http://jroller.com/desmax
               http://www.linkedin.com/in/desmax74
      http://wiki.java.net/bin/view/People/MassimilianoDessi
 http://www.jugsardegna.org/vqwiki/jsp/Wiki?MassimilianoDessi



                Spring Framework Italian User Group
      http://it.groups.yahoo.com/group/SpringFramework-it

More Related Content

Viewers also liked

[웹기반시스템 3조] mvc
[웹기반시스템 3조] mvc[웹기반시스템 3조] mvc
[웹기반시스템 3조] mvc구 봉
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesCraig Dickson
 
Spring mvc
Spring mvcSpring mvc
Spring mvcksain
 
Spring MVC
Spring MVCSpring MVC
Spring MVCymtech
 
JavaScript 2014 프론트엔드 기술 리뷰
JavaScript 2014 프론트엔드 기술 리뷰JavaScript 2014 프론트엔드 기술 리뷰
JavaScript 2014 프론트엔드 기술 리뷰Kenu, GwangNam Heo
 
가볍게 살펴보는 AngularJS
가볍게 살펴보는 AngularJS가볍게 살펴보는 AngularJS
가볍게 살펴보는 AngularJSJae Sung Park
 
자바 웹 개발 시작하기 (4주차 : MVC)
자바 웹 개발 시작하기 (4주차 : MVC)자바 웹 개발 시작하기 (4주차 : MVC)
자바 웹 개발 시작하기 (4주차 : MVC)DK Lee
 
프로젝트에서 Sw아키텍트의 역할 20140717
프로젝트에서 Sw아키텍트의 역할 20140717프로젝트에서 Sw아키텍트의 역할 20140717
프로젝트에서 Sw아키텍트의 역할 20140717Young On Kim
 
분석과 설계
분석과 설계분석과 설계
분석과 설계Haeil Yi
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014Matt Raible
 
스프링 프레임워크로 블로그 개발하기
스프링 프레임워크로 블로그 개발하기 스프링 프레임워크로 블로그 개발하기
스프링 프레임워크로 블로그 개발하기 라한사 아
 
프론트엔드로 시작하는 웹 개발 방법과 지식들
프론트엔드로 시작하는 웹 개발 방법과 지식들프론트엔드로 시작하는 웹 개발 방법과 지식들
프론트엔드로 시작하는 웹 개발 방법과 지식들Eun Cho
 
네이버 오픈세미나 백엔드_아키텍쳐
네이버 오픈세미나 백엔드_아키텍쳐네이버 오픈세미나 백엔드_아키텍쳐
네이버 오픈세미나 백엔드_아키텍쳐NAVER D2
 
SW 아키텍처 분석방법
SW 아키텍처 분석방법 SW 아키텍처 분석방법
SW 아키텍처 분석방법 YoungSu Son
 
SpringMVC 전체 흐름 알아보기
SpringMVC 전체 흐름 알아보기SpringMVC 전체 흐름 알아보기
SpringMVC 전체 흐름 알아보기Myung Woon Oh
 
초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101Chang W. Doh
 
프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS
프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS
프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS동수 장
 
Angular 2 - Core Concepts
Angular 2 - Core ConceptsAngular 2 - Core Concepts
Angular 2 - Core ConceptsFabio Biondi
 
2.네이버 프론트엔드 김지태
2.네이버 프론트엔드 김지태2.네이버 프론트엔드 김지태
2.네이버 프론트엔드 김지태NAVER D2
 

Viewers also liked (20)

[웹기반시스템 3조] mvc
[웹기반시스템 3조] mvc[웹기반시스템 3조] mvc
[웹기반시스템 3조] mvc
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web Sites
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Mvc pattern
Mvc patternMvc pattern
Mvc pattern
 
JavaScript 2014 프론트엔드 기술 리뷰
JavaScript 2014 프론트엔드 기술 리뷰JavaScript 2014 프론트엔드 기술 리뷰
JavaScript 2014 프론트엔드 기술 리뷰
 
가볍게 살펴보는 AngularJS
가볍게 살펴보는 AngularJS가볍게 살펴보는 AngularJS
가볍게 살펴보는 AngularJS
 
자바 웹 개발 시작하기 (4주차 : MVC)
자바 웹 개발 시작하기 (4주차 : MVC)자바 웹 개발 시작하기 (4주차 : MVC)
자바 웹 개발 시작하기 (4주차 : MVC)
 
프로젝트에서 Sw아키텍트의 역할 20140717
프로젝트에서 Sw아키텍트의 역할 20140717프로젝트에서 Sw아키텍트의 역할 20140717
프로젝트에서 Sw아키텍트의 역할 20140717
 
분석과 설계
분석과 설계분석과 설계
분석과 설계
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014
 
스프링 프레임워크로 블로그 개발하기
스프링 프레임워크로 블로그 개발하기 스프링 프레임워크로 블로그 개발하기
스프링 프레임워크로 블로그 개발하기
 
프론트엔드로 시작하는 웹 개발 방법과 지식들
프론트엔드로 시작하는 웹 개발 방법과 지식들프론트엔드로 시작하는 웹 개발 방법과 지식들
프론트엔드로 시작하는 웹 개발 방법과 지식들
 
네이버 오픈세미나 백엔드_아키텍쳐
네이버 오픈세미나 백엔드_아키텍쳐네이버 오픈세미나 백엔드_아키텍쳐
네이버 오픈세미나 백엔드_아키텍쳐
 
SW 아키텍처 분석방법
SW 아키텍처 분석방법 SW 아키텍처 분석방법
SW 아키텍처 분석방법
 
SpringMVC 전체 흐름 알아보기
SpringMVC 전체 흐름 알아보기SpringMVC 전체 흐름 알아보기
SpringMVC 전체 흐름 알아보기
 
초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101
 
프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS
프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS
프론트엔드 웹앱 프레임웍 - Bootstrap, Backbone 그리고 AngularJS
 
Angular 2 - Core Concepts
Angular 2 - Core ConceptsAngular 2 - Core Concepts
Angular 2 - Core Concepts
 
2.네이버 프론트엔드 김지태
2.네이버 프론트엔드 김지태2.네이버 프론트엔드 김지태
2.네이버 프론트엔드 김지태
 

Similar to The hidden gems of Spring Security

Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code HardeningOdoo
 
Shields Up! Securing React Apps
Shields Up! Securing React AppsShields Up! Securing React Apps
Shields Up! Securing React AppsZachary Klein
 
How to Use Stormpath in angular js
How to Use Stormpath in angular jsHow to Use Stormpath in angular js
How to Use Stormpath in angular jsStormpath
 
Introduction to PicketLink
Introduction to PicketLinkIntroduction to PicketLink
Introduction to PicketLinkJBUG London
 
Hacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAMHacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAMJerod Brennen
 
Federated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPIC
Federated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPICFederated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPIC
Federated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPICJohnSmithto
 
Super simple application security with Apache Shiro
Super simple application security with Apache ShiroSuper simple application security with Apache Shiro
Super simple application security with Apache ShiroMarakana Inc.
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Atlassian
 
Implementing Authorization
Implementing AuthorizationImplementing Authorization
Implementing AuthorizationTorin Sandall
 
AWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfAWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfChristopher Doman
 
How to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFSHow to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFSJohn Gasper
 
Secure Coding for NodeJS
Secure Coding for NodeJSSecure Coding for NodeJS
Secure Coding for NodeJSThang Chung
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring SecurityDzmitry Naskou
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservicesMohammed A. Imran
 
Drupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentDrupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentSteven Van den Hout
 
Synapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developerSynapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developersaritasingh19866
 
WSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - MicrogatewayWSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - MicrogatewayProfesia Srl, Lynx Group
 

Similar to The hidden gems of Spring Security (20)

Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
 
Shields Up! Securing React Apps
Shields Up! Securing React AppsShields Up! Securing React Apps
Shields Up! Securing React Apps
 
How to Use Stormpath in angular js
How to Use Stormpath in angular jsHow to Use Stormpath in angular js
How to Use Stormpath in angular js
 
Introduction to PicketLink
Introduction to PicketLinkIntroduction to PicketLink
Introduction to PicketLink
 
Rails Security
Rails SecurityRails Security
Rails Security
 
Hacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAMHacking identity: A Pen Tester's Guide to IAM
Hacking identity: A Pen Tester's Guide to IAM
 
Federated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPIC
Federated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPICFederated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPIC
Federated RBAC: Fortress, OAuth2 (Oltu), JWT, Java EE, and JASPIC
 
Super simple application security with Apache Shiro
Super simple application security with Apache ShiroSuper simple application security with Apache Shiro
Super simple application security with Apache Shiro
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
 
Implementing Authorization
Implementing AuthorizationImplementing Authorization
Implementing Authorization
 
AWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdfAWS Incident Response Cheat Sheet.pdf
AWS Incident Response Cheat Sheet.pdf
 
Security in Node.JS and Express:
Security in Node.JS and Express:Security in Node.JS and Express:
Security in Node.JS and Express:
 
Spring Security 3
Spring Security 3Spring Security 3
Spring Security 3
 
How to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFSHow to CASifying PeopleSoft and Integrating CAS and ADFS
How to CASifying PeopleSoft and Integrating CAS and ADFS
 
Secure Coding for NodeJS
Secure Coding for NodeJSSecure Coding for NodeJS
Secure Coding for NodeJS
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring Security
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservices
 
Drupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentDrupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal Development
 
Synapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developerSynapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developer
 
WSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - MicrogatewayWSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - Microgateway
 

More from Massimiliano Dessì

When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...Massimiliano Dessì
 
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome Massimiliano Dessì
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudMassimiliano Dessì
 
Web Marketing Training 2014 Community Online
Web Marketing Training 2014 Community OnlineWeb Marketing Training 2014 Community Online
Web Marketing Training 2014 Community OnlineMassimiliano Dessì
 
Vert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVMVert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVMMassimiliano Dessì
 
Reactive applications Linux Day 2013
Reactive applications Linux Day 2013Reactive applications Linux Day 2013
Reactive applications Linux Day 2013Massimiliano Dessì
 
Scala Italy 2013 extended Scalatra vs Spring MVC
Scala Italy 2013 extended Scalatra vs Spring MVCScala Italy 2013 extended Scalatra vs Spring MVC
Scala Italy 2013 extended Scalatra vs Spring MVCMassimiliano Dessì
 
Codemotion 2013 scalatra_play_spray
Codemotion 2013 scalatra_play_sprayCodemotion 2013 scalatra_play_spray
Codemotion 2013 scalatra_play_sprayMassimiliano Dessì
 
Why we cannot ignore functional programming
Why we cannot ignore functional programmingWhy we cannot ignore functional programming
Why we cannot ignore functional programmingMassimiliano Dessì
 
Three languages in thirty minutes
Three languages in thirty minutesThree languages in thirty minutes
Three languages in thirty minutesMassimiliano Dessì
 

More from Massimiliano Dessì (20)

Code One 2018 maven
Code One 2018   mavenCode One 2018   maven
Code One 2018 maven
 
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
When Old Meets New: Turning Maven into a High Scalable, Resource Efficient, C...
 
Hacking Maven Linux day 2017
Hacking Maven Linux day 2017Hacking Maven Linux day 2017
Hacking Maven Linux day 2017
 
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
Microservices in Go_Dessi_Massimiliano_Codemotion_2017_Rome
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Docker dDessi november 2015
Docker dDessi november 2015Docker dDessi november 2015
Docker dDessi november 2015
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
 
Openshift linuxday 2014
Openshift linuxday 2014Openshift linuxday 2014
Openshift linuxday 2014
 
Web Marketing Training 2014 Community Online
Web Marketing Training 2014 Community OnlineWeb Marketing Training 2014 Community Online
Web Marketing Training 2014 Community Online
 
Vert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVMVert.X like Node.js but polyglot and reactive on JVM
Vert.X like Node.js but polyglot and reactive on JVM
 
Reactive applications Linux Day 2013
Reactive applications Linux Day 2013Reactive applications Linux Day 2013
Reactive applications Linux Day 2013
 
Scala Italy 2013 extended Scalatra vs Spring MVC
Scala Italy 2013 extended Scalatra vs Spring MVCScala Italy 2013 extended Scalatra vs Spring MVC
Scala Italy 2013 extended Scalatra vs Spring MVC
 
Codemotion 2013 scalatra_play_spray
Codemotion 2013 scalatra_play_sprayCodemotion 2013 scalatra_play_spray
Codemotion 2013 scalatra_play_spray
 
Why we cannot ignore functional programming
Why we cannot ignore functional programmingWhy we cannot ignore functional programming
Why we cannot ignore functional programming
 
Scala linux day 2012
Scala linux day 2012 Scala linux day 2012
Scala linux day 2012
 
Three languages in thirty minutes
Three languages in thirty minutesThree languages in thirty minutes
Three languages in thirty minutes
 
MongoDB dessi-codemotion
MongoDB dessi-codemotionMongoDB dessi-codemotion
MongoDB dessi-codemotion
 
MongoDB Webtech conference 2010
MongoDB Webtech conference 2010MongoDB Webtech conference 2010
MongoDB Webtech conference 2010
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Spring Roo Internals Javaday IV
Spring Roo Internals Javaday IVSpring Roo Internals Javaday IV
Spring Roo Internals Javaday IV
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

The hidden gems of Spring Security

  • 1. The hidden gems of Spring Security Dessì Massimiliano Spring Meeting 27 giugno 2009 Cagliari
  • 2. Author Software Architect and Engineer ProNetics / Sourcesense Presidente JugSardegna Onlus Fondatore e coordinatore SpringFramework Italian User Group Autore Spring 2.5 Aspect Oriented Programming
  • 3. La sicurezza non viene vista dagli utenti
  • 4. La sicurezza viene percepita quando non c'è oppure è ad un livello insufficiente
  • 5. I dati sono il valore delle applicazioni
  • 6. E' necessario proteggere i dati Non farci le scommesse
  • 7. In questa presentazione vedremo varie facce della sicurezza con SpringSecurity
  • 8. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 9. REST Tutto è una risorsa Ogni risorsa ha un identificativo Representational State Transfer Tutte le risorse hanno una interfaccia uniforme GET, POST, PUT, DELETE Hypermedia as the engine of application state Client-server, Stateless, Cacheable, Layered
  • 10. REST http://www.magic-box.org/services/social/center/13 JAX-RS RESTeasy @ @Path("services/social") @Component("socialController") public class SocialController { @GET @Path("/{domain}/{id}") @Produces("application/xml") public Response getEntity(@PathParam("domain") String domain, @PathParam("id") String id) { Entity entity = null; try { entity = getEntityManager().getEntity(domain, id); } catch (InvalidEntityException e) { String[] args = { id, domain }; LOG.info("Request an invalid entity with id {} and domain {}", args); } ResponseBuilder builder = (entity == null) ? Response.noContent() : Response.ok(getEntityConverter().convert(entity)); return builder.build(); } @DELETE @Path("/{domain}/{id}") public String deleteEntity(@PathParam("domain") String domain, @PathParam("id") String id) { getEntityManager().deleteEntity(domain, id); return OK; }
  • 11. REST @POST @Path("/{domain}/{id}") @Consumes("application/xml") public String saveEntity(InputStream is, @PathParam("domain") String domain, @PathParam("id") String id){ String xml = inputStreamToString(is); Entity entity = getEntityConverter().unconvert(xml, id, domain); getEntityManager().deleteEntity(domain, id); getEntityManager().saveEntity(entity); return OK; } @PUT @Path("/{domain}/{id}") @Consumes("application/xml") public String updateEntity(InputStream is, @PathParam("domain") String domain, @PathParam("id") String id){ String xml = inputStreamToString(is); Entity entity = getEntityConverter().unconvert(xml, id, domain); getEntityManager().saveEntity(entity); return OK; .. } In Ingresso e in uscita è permesso qualunque tipo , XML, JSON, text/plain, files binari, ModelAndView, String...
  • 12. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 13. SpringSecurity SpringSecurity è il framework per la sicurezza maggiormente scaricato su sourceforge (250k). Permette di gestire qualsiasi aspetto della sicurezza di una webapplication in maniera molto accurata. Sopratutto agisce in maniera trasparente senza intervenire nel funzionamento della webapplication.
  • 14. SpringSecurity Le chiamate passano attraverso un filtro servlet <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> che propaga le informazioni di autenticazione al thread di esecuzione
  • 15. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 16. Autenticazione Processo con cui attraverso le credenziali viene verificato se l'utente è colui che dichiara di essere. <sec:authentication-provider user-service-ref="sffsUserDetailservice"> <sec:password-encoder hash="sha" /> </sec:authentication-provider> <bean id="sffsUserDetailservice" class="it.freshfruits.security.AuthenticationJdbcDaoImpl" > <property name="rolePrefix" value="ROLE_"/> <property name="dataSource" ref="dataSource"/> <property name="usersByUsernameQuery" value="SELECT username, password, enabled FROM authentication WHERE username = ?" /> <property name="authoritiesByUsernameQuery" value="SELECT username, authority FROM roles WHERE username = ?" /> </bean>
  • 18. Autorizzazione <sec:http> <sec:intercept-url pattern="/log*.jsp" filters="none" /> <sec:intercept-url pattern="*.htm" access="ROLE_USER,ROLE_ANONYMOUS" /> <sec:intercept-url pattern="*.page" access="ROLE_USER,ROLE_ADMIN" /> <sec:intercept-url pattern="*.edit" access="ROLE_USER,ROLE_ADMIN" /> <sec:intercept-url pattern="*.admin" access="ROLE_ADMIN" /> <sec:form-login login-page="/login.jsp" default-target-url="/" login-processing-url="/j_security_check" authentication-failure-url="/loginError.jsp" /> <sec:logout logout-url="/logout.jsp" logout-success url="/login.jsp" /> <sec:remember-me /> </sec:http> <bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased" > <property name="decisionVoters"> <list> <bean class="org.springframework.security.vote.RoleVoter" /> <bean class="org.springframework.security.vote.AuthenticatedVoter" /> </list> </property> </bean> <sec:global-method-security access-decision-manager-ref="accessDecisionManager"> <sec:protect-pointcut expression="execution(* it.freshfruits.domain.entity.*.*(..))" access="ROLE_USER,ROLE_ADMIN" /> </sec:global-method-security>
  • 19. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 20. Groups Possiamo utilizzare i gruppi, assegniamo i ruoli ai gruppi e assegniamo gli utenti a dei gruppi. In questo modo l'utente al login si ritroverà automaticamente i ruoli dei gruppi al quale appartiene. Modifichiamo il detailService da così: <bean id="sffsUserDetailservice" class="it.freshfruits.security.AuthenticationJdbcDaoImpl" > <property name="rolePrefix" value="ROLE_"/> <property name="dataSource" ref="dataSource"/> <property name="usersByUsernameQuery" value="SELECT username, password, enabled FROM authentication WHERE username = ?" /> <property name="authoritiesByUsernameQuery" value="SELECT username, authority FROM roles WHERE username = ?" /> </bean>
  • 21. Groups A così: <bean id="sffsUserDetailservice" class="it.freshfruits.security.AuthenticationJdbcDaoImpl"> <property name="dataSource" ref="dataSource" /> <property name="usersByUsernameQuery" value="SELECT username, password, enabled FROM authentication WHERE username = ?" /> <property name="groupAuthoritiesByUsernameQuery" value="SELECT g.id, g.group_name, ga.name FROM groups g, group_members gm, authorities ga WHERE gm.username = ? AND g.id = ga.group_id AND g.id = gm.group_id" /> <property name="enableGroups" value="true"/> <property name="enableAuthorities" value="false"/> </bean>
  • 22. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 23. OpenID “Le password sono come le mutande... Non devi farle vedere a nessuno Devi cambiarle con regolarità Non devi prestarle a nessuno” OpenID è un meccanismo decentralizzato per il single sign on. La nostra applicazione non contiene più la password, di cui si occupa un provider OpenID. Basta fornire l' username del tipo: http://max.myopenid.com
  • 24. OpenID L'autenticazione avviene esternamente sul provider openid dove verrà richiesta la password <sec:http> <sec:concurrent-session-control max-sessions="1" expired-url="/openidlogin.jsp*"/> <sec:intercept-url pattern="/openidlogin.jsp*" filters="none"/> <sec:intercept-url pattern="/" access="ROLE_USER" /> <sec:intercept-url pattern="/**" access="ROLE_USER" /> <sec:openid-login login-page="/openidlogin.jsp" default-target-url="/" /> </sec:http> ... <h3>Please Enter Your OpenID Identity</h3> <form name="f" action="<c:url value='j_spring_openid_security_check'/>" method="POST"> <table> <tr><td>OpenID Identity:</td><td><input type='text' name='j_username'value=''/></td></tr> <tr><td colspan='2'><input name="submit" type="submit"></td></tr> <tr><td colspan='2'><input name="reset" type="reset"></td></tr> </table> </form> </body> </html>
  • 25. OpenID La nostra applicazione a questo punto manterrà solo gli username e gli specifici ruoli applicativi, possiamo implementarci così il nostro UserDetailService public class FreshFruitDetailsService implements UserDetailsService { private String defaultRole; private DataSource dataSource; public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { UsersByUsernameMapping mapping = new UsersByUsernameMapping(dataSource); List users = mapping.execute(username); return (UserDetails) users.get(0); } ...
  • 26. OpenID private class UsersByUsernameMapping extends MappingSqlQuery { protected UsersByUsernameMapping(DataSource ds) { super(ds,"SELECT username, authority, enabled FROM users WHERE username = ? ;"); declareParameter(new SqlParameter(Types.VARCHAR)); compile(); } protected Object mapRow(ResultSet rs, int rownum) throws SQLException { String username = rs.getString(1); String password = rs.getString(2); boolean enabled = rs.getBoolean(3); UserDetails user = new User(username, password, enabled, true, true, true, New GrantedAuthority[] { new GrantedAuthorityImpl("HOLDER") }); return user; } } public void setDatasource(DataSource dataSource) { this.dataSource = dataSource; } }
  • 27. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 28. OAuth “An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.” Una applicazione ne autorizza un altra ad utilizzare i dati di un suo utente autenticato.
  • 29. OAuth http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd http://spring-security-oauth.codehaus.org/2.0 http://spring-security-oauth.codehaus.org/schema/spring-security-oauth-2.0.xsd"> <oauth:provider consumer-details-service-ref="consumerDetails" token-services-ref="tokenServices" request-token-url="/oauth/request_token" authenticate-token-url="/oauth/authorize" authentication-failed-url="/oauth/confirm_access" access-granted-url="/request_token_authorized.jsp" access-token-url="/oauth/access_token"/> <oauth:consumer-details-service id="consumerDetails"> <oauth:consumer name="Tonr.com" key="tonr-consumer-key" secret="SHHHHH!!!!!!!!!!" resourceName="Your Photos" resourceDescription="Your photos that you have uploaded to sparklr.com."/> </oauth:consumer-details-service> <oauth:token-services id="tokenServices"/>
  • 30. OAuth “An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.” Una applicazione ne autorizza un altra ad utilizzare i dati di un suo utente autenticato.
  • 31. OAuth http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd http://spring-security-oauth.codehaus.org/2.0 http://spring-security-oauth.codehaus.org/schema/spring-security-oauth-2.0.xsd"> <oauth:provider consumer-details-service-ref="consumerDetails" token-services-ref="tokenServices" request-token-url="/oauth/request_token" authenticate-token-url="/oauth/authorize" authentication-failed-url="/oauth/confirm_access" access-granted-url="/request_token_authorized.jsp" access-token-url="/oauth/access_token"/> <oauth:consumer-details-service id="consumerDetails"> <oauth:consumer name="Tonr.com" key="tonr-consumer-key" secret="SHHHHH!!!!!!!!!!" resourceName="Your Photos" resourceDescription="Your photos that you have uploaded to sparklr.com."/> </oauth:consumer-details-service> <oauth:token-services id="tokenServices"/>
  • 32. OAuth Oauth for Spring security http://spring-security-oauth.codehaus.org non è parte della distribuzione di Spring, ma funziona senza problemi :) Se usato con OpenID bisogna tenere conto che OpenID come Auhtentication usa un OpenIDAuthenticationToken perciò il servizio autorizzante deve tenerne conto
  • 33. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 34. ACL Una Access Control list permette di gestire i permessi sui singoli oggetti di dominio, definendo chi può fare cosa su quell' oggetto. ObjectIdentity oid = new ObjectIdentityImpl(MyClass.class, 13); MutableAcl acl = mutableAclService.createAcl(oid); acl.insertAce(0, BasePermission.READ, new GrantedAuthoritySid(role.getName()), true); acl.insertAce(1, BasePermission.WRITE, new GrantedAuthoritySid(“ROLE_WRITE”), true); acl.insertAce(2, BasePermission.CREATE, new GrantedAuthoritySid(“ROLE_CREATE”), true); acl.insertAce(3, BasePermission.DELETE, new GrantedAuthoritySid(“ROLE_DELETE”), true); acl.insertAce(4, BasePermission.ADMINISTRATION, new PrincipalSid(“ROLE_ADMIN”), true); mutableAclService.updateAcl(acl); <bean id="aclService" class="it.pronetics.acl.repository.jdbc.PostgreSqlMutableAclService" > <constructor-arg ref="dataSource" /> <constructor-arg ref="lookupStrategy" /> <constructor-arg ref="jdbcAclCache" /> <property name="sidIdentityQuery" value="select currval('acl_sid_id_seq')" /> <property name="classIdentityQuery" value="select currval('acl_class_id_seq')" /> </bean>
  • 35. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 36. AOP <!-- Securing Methods with Security Interceptor --> <bean class="org.springaop.chapter.five.security.FooServiceImpl"> <security:intercept-methods access-decision-manager-ref="accessDecisionManager"> <security:protect method="org.springaop.chapter.five.security.FooService.getBalance" access="ROLE_USER" /> <security:protect method="org.springaop.chapter.five.security.FooService.setBalanceAccount" access="ROLE_ACCOUNTING,ROLE_ADMIN" /> <security:protect method="org.springaop.chapter.five.security.FooService.suspendAccount" access="ROLE_ADMIN" /> </security:intercept-methods> </bean> <!-- Securing Methods with Pointcut--> <global-method-security access-decision-manager-ref="accessDecisionManager"> <protect-pointcut expression="execution(* org.springaop.chapter.five.security.FooService.getBalance(..))" access="ROLE_USER" /> <protect-pointcut expression="execution(* org.springaop.chapter.five.security.FooService.set*(..))" access="ROLE_ACCOUNTING,ROLE_ADMIN" /> <protect-pointcut expression="execution(*org.springaop.chapter.five.security.FooService.suspendAccount(..))" access="ROLE_ADMIN" /> </global-method-security>
  • 37. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 38. Annotations import org.springframework.security.annotation.Secured; public class FooServiceImplWithAnnotations implements FooService { @Secured("ROLE_USER") public Integer getBalance(Integer idAccount) { Integer result = 0; ... return result; } @Secured( { "ROLE_ACCOUNTING", "ROLE_ADMIN" }) public void setBalanceAccount(Integer id, Integer balance) { ... } @Secured("ROLE_ADMIN") public boolean suspendAccount(Integer id) { boolean result = false; ... return result; } }
  • 39. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 40. Spring 3 Oltre alle modifiche REST alla parte MVC, Spring 3 introduce una importante novita: Spring Expression Language (SpEL) Si tratta di un linguaggio molto espressivo che supporta l'interrogazione e la modifica di un grafo di oggetti a runtime, utilizzabile nella configurazione xml, nelle annotazioni nelle firme dei metodi
  • 41. Spring 3 Nei bean sull' xml <bean id="numberGuess" class="org.spring.samples.NumberGuess"> <property name="randomNumber" value="#{ T(java.lang.Math).random() * 100.0 }"/> </bean> <bean id="shapeGuess" class="org.spring.samples.ShapeGuess"> <property name="initialShapeSeed" value="#{ numberGuess.randomNumber }"/> </bean> e posso anche riferirli tra loro
  • 42. Spring 3 Nel codice public class SimpleMovieLister { private MovieFinder movieFinder; private String defaultLocale; @Value("#{ systemProperties['user.region'] }") public void setDefaultLocale(String defaultLocale){ this.defaultLocale = defaultLocale; } @Autowired public void configure(MovieFinder movieFinder, @Value("#{ systemProperties['user.region'] } String defaultLocale){ this.movieFinder = movieFinder; this.defaultLocale = defaultLocale; } ... }
  • 43. Agenda ✔ REST ✔ SpringSecurity ✔ Authentication/Authorization ✔ Groups ✔ OpenID ✔ OAuth ✔ ACL ✔ AOP ✔ @ Annotations ✔ Spring 3 ✔ SpringSecurity 3
  • 44. SpringSecurity 3 Posso quindi usare SpEL negli url da intercettare <http use-expressions="true"> <intercept-url pattern="/secure/**" access="hasRole('ROLE_ADMIN') and hasIpAddress('192.168.1.0/24')" /> ... </http>
  • 45. SpringSecurity 3 Posso usare delle @Pre e @Post annotazioni che lavorano insieme alla ACL e usare anche SpEL <global-method-security pre-post-annotations="enabled"/> @PreAuthorize("hasRole('ROLE_ADMIN')") public void create(Contact contact); @PreAuthorize("hasPermission(#contact, 'admin')") public void deletePermission(Contact contact, Sid recipient, Permission permission); @PreAuthorize("#contact.name == principal.name)") public void doSomething(Contact contact);
  • 46. SpringSecurity 3 Oppure posso usare SpEL per filtrare le collezioni in base ai ruoli @PreAuthorize("hasRole('ROLE_USER')") @PostFilter("hasPermission(filterObject,'read')or hasPermission(filterObject,'admin')") Public List getAll();
  • 48. Grazie per l'attenzione ! Massimiliano Dessì desmax74 at yahoo.it massimiliano.dessi at pronetics.it http://jroller.com/desmax http://jroller.com/desmax http://www.linkedin.com/in/desmax74 http://wiki.java.net/bin/view/People/MassimilianoDessi http://www.jugsardegna.org/vqwiki/jsp/Wiki?MassimilianoDessi Spring Framework Italian User Group http://it.groups.yahoo.com/group/SpringFramework-it