[Red5] persistent sessions

Daniel Rossi spam at electroteque.org
Thu Sep 27 18:32:40 PDT 2007


http://simoes.org/docs/hibernate-2.1/110.html

I believe this is exactly what i need session managers using  
hibernate in spring, just need to work out examples and the API now  
pain !

I wonder if acegi ties all this up ?

On 27/09/2007, at 10:22 PM, Daniel Rossi wrote:

> Hi there I was wondering how its possible to setup persistent  
> sessions ? I would like to setup a service that handles anonymous  
> authentication, once authenticated it returns the session to use as  
> an argument to the application connection which will then  
> authenticate the client against the session and either allow or  
> deny access.
>
> Here is what i have so far, obviouslly its simply using a user  
> access file which might be hibernate in the future. Im using a  
> SabreAMF php client to authenticate with the service to obtain the  
> session to include in along the connection in the flash client.
>
> public class TokenService {
> 	
> 	private String saltKey = "thesaltpass";
> 	private String hashword;
> 	private String newhash;
> 	
> 	public Object getToken(Object[] token)
> 	{
> 		final HashMap m=(HashMap)token[0];
>
> 		UsernamePasswordAuthenticationToken t=new  
> UsernamePasswordAuthenticationToken(m.get("username"),m.get 
> ("password"));
> 		
> 		IScope connectionScope = Red5.getConnectionLocal().getScope();
> 		
> 		ProviderManager mgr=(ProviderManager)connectionScope.getContext 
> ().getBean("authenticationManager");
> 		try {
> 			t=(UsernamePasswordAuthenticationToken)mgr.authenticate(t);
>
> 		}
> 		catch(BadCredentialsException ex)
> 		{
> 			return "Wrong login information";
> 		}
> 		
> 		if (t.isAuthenticated())
> 		{
> 			
> 			return t.hashCode();
> 		}
> 		
> 		return "";
> 		
> 	}
> 	
> 	/*
> 	public String getMessageDigest(String token) throws  
> NoSuchAlgorithmException
>     {
> 		try {
> 			MessageDigest md = MessageDigest.getInstance("MD5");
> 			md.update(token.getBytes());
> 			BigInteger hash = new BigInteger(1, md.digest());
> 			hashword = hash.toString(16);
> 		} catch (NoSuchAlgorithmException e) {
> 			
> 		}
> 		return hashword;
>     }
>     */
>
> }
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20070928/66570647/attachment-0001.html 


More information about the Red5 mailing list