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(); }
public void SetAccessTokenSession(JID Actor, AccessTokenSession Session) { AccessTokens[Actor.GetBareJID() + Session.Token] = Session; }