package com.zyeeda.framework.security.internal;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.Subject;
import org.apache.tapestry5.ioc.services.RegistryShutdownHub;

import com.zyeeda.framework.security.SecurityService;
import com.zyeeda.framework.service.AbstractService;

public class OpenIdConsumerSecurityServiceProvider extends AbstractService implements SecurityService<SecurityManager> {

	public OpenIdConsumerSecurityServiceProvider(RegistryShutdownHub shutdownHub) {
		super(shutdownHub);
	}

	@Override
	public SecurityManager getSecurityManager() {
		return SecurityUtils.getSecurityManager();
	}

	@Override
	public String getCurrentUser() {
		Subject current = SecurityUtils.getSubject();
		return current.getPrincipal().toString();
	}

}

@@ -172,16 +172,179 @@
 bject;%0D%0A
+import org.apache.tapestry5.ioc.annotations.Marker;%0D%0Aimport org.apache.tapestry5.ioc.annotations.Primary;%0D%0Aimport org.apache.tapestry5.ioc.annotations.ServiceId;%0D%0A
 import o
@@ -511,16 +511,88 @@
 ice;%0D%0A%0D%0A
+@Marker(Primary.class)%0D%0A@ServiceId(%22openid-consumer-security-service%22)%0D%0A
 public c

add ioc annotations to OpenIdConsumerSecurityServiceProvider