You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by 十三郎 <mi...@163.com> on 2013/09/25 09:37:41 UTC

i cant find [User],[LoggedIn] class in deltaspike-security-module.

 hi everyone:

i want to use deltaspike-security module in a project.

im already add deltaspike-security dependency:
----------------------------
        <dependency>
            <groupId>org.apache.deltaspike.modules</groupId>
            <artifactId>deltaspike-security-module-api</artifactId>
            <version>${deltaspike.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.deltaspike.modules</groupId>
            <artifactId>deltaspike-security-module-impl</artifactId>
            <version>${deltaspike.version}</version>
            <scope>runtime</scope>
        </dependency>
----------------------------
and i follow the offical documents to create  the Authorizer:
----------------------------

@ApplicationScopedpublicclassCustomAuthorizer{@Secures@CustomSecurityBindingpublicbooleandoSecuredCheck(InvocationContextinvocationContext,BeanManagermanager,@LoggedInUseruser)throwsException{returnuser.isLoggedIn();// perform security check}}

----------------------------
i find there is no [User] class and [LoggedIn] class.




Re: Re:about picketlink-deltaspike-authorization example.

Posted by Esteve Avilés <ea...@gmail.com>.
Hi,

What you are asking relates more to Picketlink than deltaspike, so I would
recommend you to try picketlink forums an documentation:

http://docs.jboss.org/picketlink/2/latest/reference/html/ch05.html#d5e1005

https://docs.jboss.org/author/display/PLINK/PicketLink+IDM+-+Role+Management

//Create a Role instance as object
Role newRoleInstance = new SimpleRole("superuser");

// let's create the new role
identityManager.add(newRoleInstance);

// let's retrieve the role information and see if they are properly stored
Role storedRoleInstance =
identityManager.getRole(newRoleInstance.getName());

User bob = BasicModel.getUser(identityManager, "bob");
  Role superuser = BasicModel.getRole(identityManager, "superuser");
  BasicModel.grantRole(relationshipManager, bob, superuser);


Regards,

Esteve





On Thu, Sep 26, 2013 at 5:49 AM, 十三郎 <mi...@163.com> wrote:

> hi,
> thanks very much!!!!
> in picketlink-deltaspike-authorization example,user's role added by the
> IDMInitializer class.
> i want to know how to set user's role when executing
> action="#{identity.login}"???
>
>
>
>
>
> At 2013-09-25 16:15:56,"Esteve Avilés" <ea...@gmail.com> wrote:
> >Hi,
> >
> >You can check picketlink deltaspike integration to see how to build an
> >@IsUserLoggedIn annotation:
> >
> https://github.com/picketlink/picketlink-quickstarts/tree/master/picketlink-deltaspike-authorization
> >
> >Regards,
> >Esteve
> >
> >
> >On Wed, Sep 25, 2013 at 9:49 AM, Gerhard Petracek <
> >gerhard.petracek@gmail.com> wrote:
> >
> >> hi,
> >>
> >> you have to use your own user-class and qualifier.
> >>
> >> regards,
> >> gerhard
> >>
> >>
> >>
> >> 2013/9/25 十三郎 <mi...@163.com>
> >>
> >> >  hi everyone:
> >> >
> >> > i want to use deltaspike-security module in a project.
> >> >
> >> > im already add deltaspike-security dependency:
> >> > ----------------------------
> >> >         <dependency>
> >> >             <groupId>org.apache.deltaspike.modules</groupId>
> >> >             <artifactId>deltaspike-security-module-api</artifactId>
> >> >             <version>${deltaspike.version}</version>
> >> >             <scope>compile</scope>
> >> >         </dependency>
> >> >         <dependency>
> >> >             <groupId>org.apache.deltaspike.modules</groupId>
> >> >             <artifactId>deltaspike-security-module-impl</artifactId>
> >> >             <version>${deltaspike.version}</version>
> >> >             <scope>runtime</scope>
> >> >         </dependency>
> >> > ----------------------------
> >> > and i follow the offical documents to create  the Authorizer:
> >> > ----------------------------
> >> >
> >> > @ApplicationScopedpublicclassCustomAuthorizer{@Secures
> >>
> @CustomSecurityBindingpublicbooleandoSecuredCheck(InvocationContextinvocationContext,BeanManagermanager,@LoggedInUseruser)throwsException{returnuser.isLoggedIn();//
> >> > perform security check}}
> >> >
> >> > ----------------------------
> >> > i find there is no [User] class and [LoggedIn] class.
> >> >
> >> >
> >> >
> >> >
> >>
> >
> >
> >
> >--
> >Esteve Avilés
>



-- 
Esteve Avilés

Re:Re:about picketlink-deltaspike-authorization example.

Posted by 十三郎 <mi...@163.com>.
hi,
thanks very much!!!!
in picketlink-deltaspike-authorization example,user's role added by the IDMInitializer class.
i want to know how to set user's role when executing action="#{identity.login}"???





At 2013-09-25 16:15:56,"Esteve Avilés" <ea...@gmail.com> wrote:
>Hi,
>
>You can check picketlink deltaspike integration to see how to build an
>@IsUserLoggedIn annotation:
>https://github.com/picketlink/picketlink-quickstarts/tree/master/picketlink-deltaspike-authorization
>
>Regards,
>Esteve
>
>
>On Wed, Sep 25, 2013 at 9:49 AM, Gerhard Petracek <
>gerhard.petracek@gmail.com> wrote:
>
>> hi,
>>
>> you have to use your own user-class and qualifier.
>>
>> regards,
>> gerhard
>>
>>
>>
>> 2013/9/25 十三郎 <mi...@163.com>
>>
>> >  hi everyone:
>> >
>> > i want to use deltaspike-security module in a project.
>> >
>> > im already add deltaspike-security dependency:
>> > ----------------------------
>> >         <dependency>
>> >             <groupId>org.apache.deltaspike.modules</groupId>
>> >             <artifactId>deltaspike-security-module-api</artifactId>
>> >             <version>${deltaspike.version}</version>
>> >             <scope>compile</scope>
>> >         </dependency>
>> >         <dependency>
>> >             <groupId>org.apache.deltaspike.modules</groupId>
>> >             <artifactId>deltaspike-security-module-impl</artifactId>
>> >             <version>${deltaspike.version}</version>
>> >             <scope>runtime</scope>
>> >         </dependency>
>> > ----------------------------
>> > and i follow the offical documents to create  the Authorizer:
>> > ----------------------------
>> >
>> > @ApplicationScopedpublicclassCustomAuthorizer{@Secures
>> @CustomSecurityBindingpublicbooleandoSecuredCheck(InvocationContextinvocationContext,BeanManagermanager,@LoggedInUseruser)throwsException{returnuser.isLoggedIn();//
>> > perform security check}}
>> >
>> > ----------------------------
>> > i find there is no [User] class and [LoggedIn] class.
>> >
>> >
>> >
>> >
>>
>
>
>
>-- 
>Esteve Avilés

Re: i cant find [User],[LoggedIn] class in deltaspike-security-module.

Posted by Esteve Avilés <ea...@gmail.com>.
Hi,

You can check picketlink deltaspike integration to see how to build an
@IsUserLoggedIn annotation:
https://github.com/picketlink/picketlink-quickstarts/tree/master/picketlink-deltaspike-authorization

Regards,
Esteve


On Wed, Sep 25, 2013 at 9:49 AM, Gerhard Petracek <
gerhard.petracek@gmail.com> wrote:

> hi,
>
> you have to use your own user-class and qualifier.
>
> regards,
> gerhard
>
>
>
> 2013/9/25 十三郎 <mi...@163.com>
>
> >  hi everyone:
> >
> > i want to use deltaspike-security module in a project.
> >
> > im already add deltaspike-security dependency:
> > ----------------------------
> >         <dependency>
> >             <groupId>org.apache.deltaspike.modules</groupId>
> >             <artifactId>deltaspike-security-module-api</artifactId>
> >             <version>${deltaspike.version}</version>
> >             <scope>compile</scope>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.deltaspike.modules</groupId>
> >             <artifactId>deltaspike-security-module-impl</artifactId>
> >             <version>${deltaspike.version}</version>
> >             <scope>runtime</scope>
> >         </dependency>
> > ----------------------------
> > and i follow the offical documents to create  the Authorizer:
> > ----------------------------
> >
> > @ApplicationScopedpublicclassCustomAuthorizer{@Secures
> @CustomSecurityBindingpublicbooleandoSecuredCheck(InvocationContextinvocationContext,BeanManagermanager,@LoggedInUseruser)throwsException{returnuser.isLoggedIn();//
> > perform security check}}
> >
> > ----------------------------
> > i find there is no [User] class and [LoggedIn] class.
> >
> >
> >
> >
>



-- 
Esteve Avilés

Re: i cant find [User],[LoggedIn] class in deltaspike-security-module.

Posted by Gerhard Petracek <ge...@gmail.com>.
hi,

you have to use your own user-class and qualifier.

regards,
gerhard



2013/9/25 十三郎 <mi...@163.com>

>  hi everyone:
>
> i want to use deltaspike-security module in a project.
>
> im already add deltaspike-security dependency:
> ----------------------------
>         <dependency>
>             <groupId>org.apache.deltaspike.modules</groupId>
>             <artifactId>deltaspike-security-module-api</artifactId>
>             <version>${deltaspike.version}</version>
>             <scope>compile</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.deltaspike.modules</groupId>
>             <artifactId>deltaspike-security-module-impl</artifactId>
>             <version>${deltaspike.version}</version>
>             <scope>runtime</scope>
>         </dependency>
> ----------------------------
> and i follow the offical documents to create  the Authorizer:
> ----------------------------
>
> @ApplicationScopedpublicclassCustomAuthorizer{@Secures@CustomSecurityBindingpublicbooleandoSecuredCheck(InvocationContextinvocationContext,BeanManagermanager,@LoggedInUseruser)throwsException{returnuser.isLoggedIn();//
> perform security check}}
>
> ----------------------------
> i find there is no [User] class and [LoggedIn] class.
>
>
>
>