示例#1
0
        List <ResourceAccess> GetAccessRights(DXMPP.JID Actor, AccessToken Token)
        {
            try
            {
                AccessTokenSession TV = AccessTokens[Actor.GetBareJID() + Token];

                if (TV.ExpiresAtUTC <= DateTime.UtcNow)
                {
                    AccessTokens.TryRemove(Token, out TV);
                    throw new AccessViolation();
                }

                if (TV.Actor.GetBareJID() != Actor.GetBareJID())
                {
                    throw new AccessViolation();
                }

                return(TV.Rights);
            }
            catch
            {
                if (ForceAccessTokenSessions)
                {
                    throw new AccessViolation();
                }
            }

            throw new AccessViolation();
        }
示例#2
0
 public void SetAccessTokenSession(JID Actor, AccessTokenSession Session)
 {
     AccessTokens[Actor.GetBareJID() + Session.Token] = Session;
 }