Package org.jboss.resteasy.skeleton.key.representations

Examples of org.jboss.resteasy.skeleton.key.representations.SkeletonKeyToken.principal()


   {
      if (skeletonKeyConfig.getResources().size() != 0)
      {
         SkeletonKeyToken token = new SkeletonKeyToken();
         token.id(generateId());
         token.principal(admin);
         token.audience(skeletonKeyConfig.getRealm());
         SkeletonKeyToken.Access realmAccess = new SkeletonKeyToken.Access();
         realmAccess.addRole(skeletonKeyConfig.getAdminRole());
         token.setRealmAccess(realmAccess);
         String tokenString = buildTokenString(realmPrivateKey, token);
View Full Code Here


   protected SkeletonKeyToken buildToken(GenericPrincipal gp)
   {
      SkeletonKeyToken token = new SkeletonKeyToken();
      token.id(generateId());
      token.principal(gp.getName());
      token.audience(skeletonKeyConfig.getRealm());
      int expiration = skeletonKeyConfig.getAccessCodeLifetime() == 0 ? 3600 : skeletonKeyConfig.getAccessCodeLifetime();
      if (skeletonKeyConfig.getTokenLifetime() > 0)
      {
         token.expiration((System.currentTimeMillis() / 1000) + expiration);
View Full Code Here

   protected SkeletonKeyToken createAccessToken(User user, Realm realm)
   {
      List<Resource> resources = identityManager.getResources(realm);
      SkeletonKeyToken token = new SkeletonKeyToken();
      token.id(generateId());
      token.principal(user.getUsername());
      token.audience(realm.getName());
      if (realm.getTokenLifespan() > 0)
      {
         token.expiration((System.currentTimeMillis() / 1000) + realm.getTokenLifespan());
      }
View Full Code Here

      SkeletonKeyToken token = null;
      if (scopeParam != null)
      {
         token = new SkeletonKeyToken();
         token.id(generateId());
         token.principal(user.getUsername());
         token.audience(realm.getName());
         if (realm.getTokenLifespan() > 0)
         {
            token.expiration((System.currentTimeMillis() / 1000) + realm.getTokenLifespan());
         }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.