You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by oc...@yupiik.com, oc...@yupiik.com on 2018/07/19 09:13:51 UTC

how to setup oauth2 AuthorizationCodeGrantService

Hi,

I am using the AuthorizationCodeGrantService but when I call "/authorize?response_type=code&scope=public&client_id=q4PuwiPH6nhj5A&redirect_uri=http://test.fr" I see the request reaching the code but then I get a 401 because the code looks for "securityContext.getUserPrincipal()". 

do I have to setup a filter before? 
do i have to link this filter with another LDAP or the authorizaiton service?

as far as I understood I was supposed to be redirected to a login form or I can also provide clientId:clientSecret B64 as basic authentication
but I don't get how to setup the whole thing

can you help on this topic?

thanks,


Re: how to setup oauth2 AuthorizationCodeGrantService

Posted by oc...@yupiik.com, oc...@yupiik.com.
thanks, I'll try to use syncope as Identity Manager and add this filter on my AuthorizationCodeGrantService conf.


On 2018/07/19 14:41:51, Colm O hEigeartaigh <co...@apache.org> wrote: 
> Hi,
> 
> The AuthorizationCodeGrantService must have a way of identifying the
> end-user. The tests in CXF configure it with a basic authentication filter,
> for example:
> 
> https://github.com/apache/cxf/blob/master/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml
> 
> Please note that CXF does not ship an "out of the box" OAuth 2.0 service.
> Instead it has all of the classes required to implement it. However, you
> would still need to write the user-interface for it. So in this case,
> configure CXF to return a form to authenticate the user, etc.
> 
> Colm.
> 
> 
> On Thu, Jul 19, 2018 at 10:13 AM, ococucci@yupiik.com <oc...@yupiik.com>
> wrote:
> 
> > Hi,
> >
> > I am using the AuthorizationCodeGrantService but when I call
> > "/authorize?response_type=code&scope=public&client_id=
> > q4PuwiPH6nhj5A&redirect_uri=http://test.fr" I see the request reaching
> > the code but then I get a 401 because the code looks for "securityContext.getUserPrincipal()".
> >
> >
> > do I have to setup a filter before?
> > do i have to link this filter with another LDAP or the authorizaiton
> > service?
> >
> > as far as I understood I was supposed to be redirected to a login form or
> > I can also provide clientId:clientSecret B64 as basic authentication
> > but I don't get how to setup the whole thing
> >
> > can you help on this topic?
> >
> > thanks,
> >
> >
> 
> 
> -- 
> Colm O hEigeartaigh
> 
> Talend Community Coder
> http://coders.talend.com
> 

Re: how to setup oauth2 AuthorizationCodeGrantService

Posted by Colm O hEigeartaigh <co...@apache.org>.
Hi,

The AuthorizationCodeGrantService must have a way of identifying the
end-user. The tests in CXF configure it with a basic authentication filter,
for example:

https://github.com/apache/cxf/blob/master/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/oauth2/grants/grants-server.xml

Please note that CXF does not ship an "out of the box" OAuth 2.0 service.
Instead it has all of the classes required to implement it. However, you
would still need to write the user-interface for it. So in this case,
configure CXF to return a form to authenticate the user, etc.

Colm.


On Thu, Jul 19, 2018 at 10:13 AM, ococucci@yupiik.com <oc...@yupiik.com>
wrote:

> Hi,
>
> I am using the AuthorizationCodeGrantService but when I call
> "/authorize?response_type=code&scope=public&client_id=
> q4PuwiPH6nhj5A&redirect_uri=http://test.fr" I see the request reaching
> the code but then I get a 401 because the code looks for "securityContext.getUserPrincipal()".
>
>
> do I have to setup a filter before?
> do i have to link this filter with another LDAP or the authorizaiton
> service?
>
> as far as I understood I was supposed to be redirected to a login form or
> I can also provide clientId:clientSecret B64 as basic authentication
> but I don't get how to setup the whole thing
>
> can you help on this topic?
>
> thanks,
>
>


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com