SlideShare una empresa de Scribd logo
1 de 10
MULE –Component Authorization
Using Spring Security
2
Component Authorization Using Spring Security
This page describes how you can configure method-level authorization
using Spring Security on your components so that users with different roles
can only invoke certain methods.
3
Securing Flow Components
To secure MethodInvocations, you must add a properly configured
MethodSecurityInterceptor into the application context. The beans requiring
security are chained into the interceptor. This chaining is accomplished
using Spring’s ProxyFactoryBean or BeanNameAutoProxyCreator.
Alternatively, Spring Security provides a MethodDefinitionSourceAdvisor,
which you can use with Spring’s DefaultAdvisorAutoProxyCreator to
automatically chain the security interceptor in front of any beans defined
against the MethodSecurityInterceptor.
4
In addition to the daoAuthenticationProvider and inMemoryDaoImpl beans
(see Configuring Security), the following beans must be configured:
MethodSecurityInterceptor
AuthenticationManager
AccessDecisionManager
AutoProxyCreator
RoleVoter
5
The MethodSecurityInterceptor
The MethodSecurityInterceptor is configured with a reference to the
following:
AuthenticationManager
AccessDecisionManager
6
Following is a security interceptor for intercepting calls made to the
methods of a component myComponent, which defines two methods:
delete and writeSomething. Roles are set on these methods as seen below
in the property securityMetadataSource.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mule="http://www.mulesource.org/schema/mule/core"
xmlns:mule-ss="http://www.mulesource.org/schema/mule/spring-security"
...cut...
<bean id="myComponentSecurity"
class="org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor">
<property name="authenticationManager" ref="authenticationManager"/>
<property name="accessDecisionManager" ref="accessDecisionManager"/>
<property name="securityMetadataSource">
<value>
com.foo.myComponent.delete=ROLE_ADMIN
com.foo.myComponent.writeSomething=ROLE_ANONYMOUS
</value>
</property>
</bean>
7
The AuthenticationManager
This bean is responsible for passing requests through a chain of AuthenticationProvider objects.
<bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
<property name= "providers">
<list>
<ref local="daoAuthenticationProvider"/>
</list>
</property>
</bean>
8
The AccessDecisionManager
This bean specifies that a user can access the protected methods if they
have any one of the roles specified in the securityMetadataSource.
<bean id="accessDecisionManager"
class='org.springframework.security.access.vote.AffirmativeBased'>
<property name="decisionVoters">
<list>
<ref bean="roleVoter"/>
</list>
</property>
</bean>
9
The AutoProxyCreator
This bean defines a proxy for the protected bean. When an application
asks Spring for a myComponent bean, it will get this proxy instead.
<bean id="autoProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<list>
<value>myComponentSecurity</value>
</list>
</property>
<property name="beanNames">
<list>
<value>myComponent</value>
</list>
</property>
<property name='proxyTargetClass' value="true"/>
</bean>
Security   authorization using spring security

Más contenido relacionado

Destacado

Organismos genéticamente modificados
Organismos genéticamente modificadosOrganismos genéticamente modificados
Organismos genéticamente modificadosLuis Hernández
 
Mobile TV Forecasts
Mobile TV ForecastsMobile TV Forecasts
Mobile TV Forecastsdavidsmuir
 
portas abertas
portas abertasportas abertas
portas abertasangy
 
Pure Storage Customer Business and IT Transformation
Pure Storage Customer Business and IT TransformationPure Storage Customer Business and IT Transformation
Pure Storage Customer Business and IT TransformationChuck Quigley
 
UXtalks #5, Selin Kumral Alkan, UX ve Psikoloji
UXtalks #5, Selin Kumral Alkan, UX ve PsikolojiUXtalks #5, Selin Kumral Alkan, UX ve Psikoloji
UXtalks #5, Selin Kumral Alkan, UX ve PsikolojiUXservices
 
The Formula for Maximum Oracle Database Performance
The Formula for Maximum Oracle Database PerformanceThe Formula for Maximum Oracle Database Performance
The Formula for Maximum Oracle Database PerformancePure Storage
 
CURRENT TREND IN INTERNET BANKING (SUBJECT -ENGINEERING ECONOMICS AND MANAG...
CURRENT TREND  IN INTERNET BANKING (SUBJECT -ENGINEERING  ECONOMICS AND MANAG...CURRENT TREND  IN INTERNET BANKING (SUBJECT -ENGINEERING  ECONOMICS AND MANAG...
CURRENT TREND IN INTERNET BANKING (SUBJECT -ENGINEERING ECONOMICS AND MANAG...Vraj Patel
 

Destacado (11)

Organismos genéticamente modificados
Organismos genéticamente modificadosOrganismos genéticamente modificados
Organismos genéticamente modificados
 
China2
China2China2
China2
 
Mobile TV Forecasts
Mobile TV ForecastsMobile TV Forecasts
Mobile TV Forecasts
 
1012_gui_ragida_2
1012_gui_ragida_21012_gui_ragida_2
1012_gui_ragida_2
 
Bab 5
Bab 5Bab 5
Bab 5
 
Varney_2015
Varney_2015Varney_2015
Varney_2015
 
portas abertas
portas abertasportas abertas
portas abertas
 
Pure Storage Customer Business and IT Transformation
Pure Storage Customer Business and IT TransformationPure Storage Customer Business and IT Transformation
Pure Storage Customer Business and IT Transformation
 
UXtalks #5, Selin Kumral Alkan, UX ve Psikoloji
UXtalks #5, Selin Kumral Alkan, UX ve PsikolojiUXtalks #5, Selin Kumral Alkan, UX ve Psikoloji
UXtalks #5, Selin Kumral Alkan, UX ve Psikoloji
 
The Formula for Maximum Oracle Database Performance
The Formula for Maximum Oracle Database PerformanceThe Formula for Maximum Oracle Database Performance
The Formula for Maximum Oracle Database Performance
 
CURRENT TREND IN INTERNET BANKING (SUBJECT -ENGINEERING ECONOMICS AND MANAG...
CURRENT TREND  IN INTERNET BANKING (SUBJECT -ENGINEERING  ECONOMICS AND MANAG...CURRENT TREND  IN INTERNET BANKING (SUBJECT -ENGINEERING  ECONOMICS AND MANAG...
CURRENT TREND IN INTERNET BANKING (SUBJECT -ENGINEERING ECONOMICS AND MANAG...
 

Similar a Security authorization using spring security

Spring Security
Spring SecuritySpring Security
Spring SecuritySumit Gole
 
Web Security Patterns - Jazoon 2010 - Zurich
Web Security Patterns - Jazoon 2010 - ZurichWeb Security Patterns - Jazoon 2010 - Zurich
Web Security Patterns - Jazoon 2010 - Zurichjavagroup2006
 
Spring security4.x
Spring security4.xSpring security4.x
Spring security4.xZeeshan Khan
 
Spring security jwt tutorial toptal
Spring security jwt tutorial   toptalSpring security jwt tutorial   toptal
Spring security jwt tutorial toptaljbsysatm
 
Developing With JAAS
Developing With JAASDeveloping With JAAS
Developing With JAASrahmed_sct
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasKhasim Saheb
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasPhaniu
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasPhaniu
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaascharan teja R
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasAnand kalla
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasirfan1008
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaashimajareddys
 
Azure Security Best Practises for Enterprises
Azure Security Best Practises for EnterprisesAzure Security Best Practises for Enterprises
Azure Security Best Practises for EnterprisesNuvento Systems Pvt Ltd
 
Data protection api's in asp dot net
Data protection api's in asp dot netData protection api's in asp dot net
Data protection api's in asp dot netsonia merchant
 

Similar a Security authorization using spring security (20)

Spring Security
Spring SecuritySpring Security
Spring Security
 
Web Security Patterns - Jazoon 2010 - Zurich
Web Security Patterns - Jazoon 2010 - ZurichWeb Security Patterns - Jazoon 2010 - Zurich
Web Security Patterns - Jazoon 2010 - Zurich
 
Spring security4.x
Spring security4.xSpring security4.x
Spring security4.x
 
Spring security jwt tutorial toptal
Spring security jwt tutorial   toptalSpring security jwt tutorial   toptal
Spring security jwt tutorial toptal
 
Developing With JAAS
Developing With JAASDeveloping With JAAS
Developing With JAAS
 
Spring Security Framework
Spring Security FrameworkSpring Security Framework
Spring Security Framework
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaas
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaas
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule security - jaas
Mule  security - jaasMule  security - jaas
Mule security - jaas
 
Azure Security Best Practises for Enterprises
Azure Security Best Practises for EnterprisesAzure Security Best Practises for Enterprises
Azure Security Best Practises for Enterprises
 
Java EE Services
Java EE ServicesJava EE Services
Java EE Services
 
MULE-JAAS
MULE-JAASMULE-JAAS
MULE-JAAS
 
Web security
Web securityWeb security
Web security
 
Data protection api's in asp dot net
Data protection api's in asp dot netData protection api's in asp dot net
Data protection api's in asp dot net
 

Más de charan teja R

Mule cloud hub console overview
Mule   cloud hub console overviewMule   cloud hub console overview
Mule cloud hub console overviewcharan teja R
 
Mule deploying a cloud hub application
Mule deploying a cloud hub applicationMule deploying a cloud hub application
Mule deploying a cloud hub applicationcharan teja R
 
Security spring security manager
Security   spring security managerSecurity   spring security manager
Security spring security managercharan teja R
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gatewaycharan teja R
 
Mule security - saml
Mule  security - samlMule  security - saml
Mule security - samlcharan teja R
 
Mule anypoint workday-devkit
Mule  anypoint workday-devkitMule  anypoint workday-devkit
Mule anypoint workday-devkitcharan teja R
 
Mule anypoint workday-connectors
Mule  anypoint workday-connectorsMule  anypoint workday-connectors
Mule anypoint workday-connectorscharan teja R
 
Mule microsoft environment
Mule  microsoft environmentMule  microsoft environment
Mule microsoft environmentcharan teja R
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layercharan teja R
 
Mule salesforce integration solutions
Mule  salesforce integration solutionsMule  salesforce integration solutions
Mule salesforce integration solutionscharan teja R
 
Mule with jdbc(my sql)
Mule with jdbc(my sql)Mule with jdbc(my sql)
Mule with jdbc(my sql)charan teja R
 

Más de charan teja R (19)

Mule cloud hub console overview
Mule   cloud hub console overviewMule   cloud hub console overview
Mule cloud hub console overview
 
Mule deploying a cloud hub application
Mule deploying a cloud hub applicationMule deploying a cloud hub application
Mule deploying a cloud hub application
 
Security spring security manager
Security   spring security managerSecurity   spring security manager
Security spring security manager
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Mule B2B
Mule B2BMule B2B
Mule B2B
 
Mule security
Mule  securityMule  security
Mule security
 
Mule security - pgp
Mule  security - pgpMule  security - pgp
Mule security - pgp
 
Mule security - saml
Mule  security - samlMule  security - saml
Mule security - saml
 
Mule anypoint workday-devkit
Mule  anypoint workday-devkitMule  anypoint workday-devkit
Mule anypoint workday-devkit
 
Mule anypoint workday-connectors
Mule  anypoint workday-connectorsMule  anypoint workday-connectors
Mule anypoint workday-connectors
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule connectors
Mule  connectorsMule  connectors
Mule connectors
 
Mule microsoft environment
Mule  microsoft environmentMule  microsoft environment
Mule microsoft environment
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layer
 
Mule salesforce integration solutions
Mule  salesforce integration solutionsMule  salesforce integration solutions
Mule salesforce integration solutions
 
Mule with jdbc(my sql)
Mule with jdbc(my sql)Mule with jdbc(my sql)
Mule with jdbc(my sql)
 
Mule esb usecase
Mule esb usecaseMule esb usecase
Mule esb usecase
 
Mule saas
Mule  saasMule  saas
Mule saas
 
Mule esb
Mule esbMule esb
Mule esb
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Security authorization using spring security

  • 2. 2 Component Authorization Using Spring Security This page describes how you can configure method-level authorization using Spring Security on your components so that users with different roles can only invoke certain methods.
  • 3. 3 Securing Flow Components To secure MethodInvocations, you must add a properly configured MethodSecurityInterceptor into the application context. The beans requiring security are chained into the interceptor. This chaining is accomplished using Spring’s ProxyFactoryBean or BeanNameAutoProxyCreator. Alternatively, Spring Security provides a MethodDefinitionSourceAdvisor, which you can use with Spring’s DefaultAdvisorAutoProxyCreator to automatically chain the security interceptor in front of any beans defined against the MethodSecurityInterceptor.
  • 4. 4 In addition to the daoAuthenticationProvider and inMemoryDaoImpl beans (see Configuring Security), the following beans must be configured: MethodSecurityInterceptor AuthenticationManager AccessDecisionManager AutoProxyCreator RoleVoter
  • 5. 5 The MethodSecurityInterceptor The MethodSecurityInterceptor is configured with a reference to the following: AuthenticationManager AccessDecisionManager
  • 6. 6 Following is a security interceptor for intercepting calls made to the methods of a component myComponent, which defines two methods: delete and writeSomething. Roles are set on these methods as seen below in the property securityMetadataSource. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mule="http://www.mulesource.org/schema/mule/core" xmlns:mule-ss="http://www.mulesource.org/schema/mule/spring-security" ...cut... <bean id="myComponentSecurity" class="org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor"> <property name="authenticationManager" ref="authenticationManager"/> <property name="accessDecisionManager" ref="accessDecisionManager"/> <property name="securityMetadataSource"> <value> com.foo.myComponent.delete=ROLE_ADMIN com.foo.myComponent.writeSomething=ROLE_ANONYMOUS </value> </property> </bean>
  • 7. 7 The AuthenticationManager This bean is responsible for passing requests through a chain of AuthenticationProvider objects. <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager"> <property name= "providers"> <list> <ref local="daoAuthenticationProvider"/> </list> </property> </bean>
  • 8. 8 The AccessDecisionManager This bean specifies that a user can access the protected methods if they have any one of the roles specified in the securityMetadataSource. <bean id="accessDecisionManager" class='org.springframework.security.access.vote.AffirmativeBased'> <property name="decisionVoters"> <list> <ref bean="roleVoter"/> </list> </property> </bean>
  • 9. 9 The AutoProxyCreator This bean defines a proxy for the protected bean. When an application asks Spring for a myComponent bean, it will get this proxy instead. <bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <property name="interceptorNames"> <list> <value>myComponentSecurity</value> </list> </property> <property name="beanNames"> <list> <value>myComponent</value> </list> </property> <property name='proxyTargetClass' value="true"/> </bean>