| From Man H Sent 22:55 Thứ ba, ngày 6 tháng hai năm 2018 Reply To [email protected] Subject Re: [cas-user] Problmes with Oauth grant type Password - CAS 5.1.4 |
yes
2018-02-06 12:23 GMT-03:00 Leo Pintos <[email protected]>:
Hi Manfredo,
When I define Oauth service with (OAuthRegisteredService), Is not a Service registration?
Should I register the same service generically and for Oauth separately or can I do it in the same JSON?
You suggest me define app_prueba like a generic service like the follow JSON:
{
/*
Generic service definition that applies to https/imaps urls
that wish to register with CAS for authentication.
*/
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "^(https?):.*",
"name" : "HTTPS",
"id" : 10000001,
}
When I define app_prueba with OAuthRegisteredService I assume its registration as a generic service.
Thank you for your support.
Leo.
El martes, 6 de febrero de 2018, 12:00:54 (UTC-3), Manfredo Hopp escribió:You should define app_prueba as a serviceEl martes, 6 de febrero de 2018, Leo Pintos <[email protected]> escribió:Hi Guys!
I' ve working with curl command:
curl -X POST -k -i 'https://DOMAIN/cas/oauth2.0/accessToken?grant_type=password '&client_id=app_prueba&username =USER&password=PASS&service= URLREDIRECTION
JSON:
{
"@class" : "org.apereo.cas.support.oauth.services.OAuthRegisteredServic e",
"clientId": "app_prueba",
"clientSecret": "clientSecret",
"bypassApprovalPrompt": true,
"generateRefreshToken": false,
"serviceId" : "^(https?)://.*",
"name" : "MyOAuthservice",
"id" : 10000002
}
Log;
2018-01-24 16:19:59,135 ERROR [org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessTok enEndpointController] (default task-15) Could not identify and extract access token request: org.apereo.cas.services.Unauth orizedServiceException: Unauthorized Service Access. Service [app_prueba] is not found in service registry.
at org.apereo.cas.services.RegisteredServiceAccessStrategyUtils .ensureServiceAccessIsAllowed( RegisteredServiceAccessStrateg yUtils.java:53)
at org.apereo.cas.services.RegisteredServiceAccessStrategyUtils .ensureServiceAccessIsAllowed( RegisteredServiceAccessStrateg yUtils.java:69)
at org.apereo.cas.services.RegisteredServiceAccessStrategyUtils .ensurePrincipalAccessIsAllowe dForService(RegisteredServiceA ccessStrategyUtils.java:85)
at org.apereo.cas.DefaultCentralAuthenticationService.createTic ketGrantingTicket(DefaultCentr alAuthenticationService.java: 362)
at org.apereo.cas.DefaultCentralAuthenticationService$$ FastClassBySpringCGLIB$$ b02e48f2.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodPro xy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodI nvocation.invokeJoinpoint( CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJo inPoint.proceed(MethodInvocati onProceedingJoinPoint.java:85)
at org.apereo.inspektr.audit.AuditTrailManagementAspect.handleA uditTrail(AuditTrailManagement Aspect.java:134)
at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invoke AdviceMethodWithGivenArgs( AbstractAspectJAdvice.java:629 )
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invoke AdviceMethod(AbstractAspectJAd vice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke( AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:168)
at org.springframework.transaction.interceptor.TransactionInter ceptor$1.proceedWithInvocation (TransactionInterceptor.java:9 9)
at org.springframework.transaction.interceptor.TransactionAspec tSupport.invokeWithinTransacti on(TransactionAspectSupport. java:282)
at org.springframework.transaction.interceptor.TransactionInter ceptor.invoke(TransactionInter ceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationIntercep tor.invoke(ExposeInvocationInt erceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvis edInterceptor.intercept( CglibAopProxy.java:673)
at org.apereo.cas.DefaultCentralAuthenticationService$$ EnhancerBySpringCGLIB$$e00035a 3.createTicketGrantingTicket(< generated>)
at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsin gReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation .invokeJoinpoint(ReflectiveMet hodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:157)
at org.springframework.transaction.interceptor.TransactionInter ceptor$1.proceedWithInvocation (TransactionInterceptor.java:9 9)
at org.springframework.transaction.interceptor.TransactionAspec tSupport.invokeWithinTransacti on(TransactionAspectSupport. java:282)
at org.springframework.transaction.interceptor.TransactionInter ceptor.invoke(TransactionInter ceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke( JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy164.createTicketGrantingTicket(Unknown Source)
at org.apereo.cas.support.oauth.web.response.accesstoken.ext.Ac cessTokenPasswordGrantRequestE xtractor.extract(AccessTokenPa sswordGrantRequestExtractor. java:79)
at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessToke nEndpointController.examineAnd ExtractAccessTokenGrantRequest (OAuth20AccessTokenEndpointCon troller.java:189)
at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessToke nEndpointController. handleRequest(OAuth20AccessTok enEndpointController.java:111)
at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessToke nEndpointController$$FastClass BySpringCGLIB$$db180f28. invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodPro xy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodI nvocation.invokeJoinpoint( CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:157)
at org.springframework.aop.support.DelegatingIntroductionInterc eptor.doProceed(DelegatingIntr oductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterc eptor.invoke(DelegatingIntrodu ctionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation .proceed(ReflectiveMethodInvoc ation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvis edInterceptor.intercept( CglibAopProxy.java:673)
at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessToke nEndpointController$$ EnhancerBySpringCGLIB$$ c3f88027.handleRequest(<genera ted>)
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMetho d.doInvoke(InvocableHandlerMet hod.java:205)
at org.springframework.web.method.support.InvocableHandlerMetho d.invokeForRequest(InvocableHa ndlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.Servle tInvocableHandlerMethod.invoke AndHandle(ServletInvocableHand lerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.Reques tMappingHandlerAdapter.invokeH andlerMethod(RequestMappingHan dlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.Reques tMappingHandlerAdapter.handleI nternal(RequestMappingHandlerA dapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMe thodAdapter.handle(AbstractHan dlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch (DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService( DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequ est(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost( FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service( FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(Se rvletHandler.java:85)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.d oFilter(FilterHandler.java:129 )
at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log 4jServletFilter.java:71)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilte r.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.d oFilter(FilterHandler.java:131 )
at org.springframework.boot.web.filter.ApplicationContextHeader Filter.doFilterInternal(Applic ationContextHeaderFilter.java: 55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java: 107)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilte r.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.d oFilter(FilterHandler.java:131 )
at org.apereo.cas.web.support.AuthenticationCredentialsLocalBin derClearingFilter.doFilter(Aut henticationCredentialsLocalBin derClearingFilter.java:28)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilte r.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.d oFilter(FilterHandler.java:131 )
at org.apereo.cas.security.RequestParameterPolicyEnforcementFil ter.doFilter(RequestParameterP olicyEnforcementFilter.java: 261)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilte r.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.d oFilter(FilterHandler.java:131 )
at org.apereo.cas.security.ResponseHeadersEnforcementFilter. doFilter(ResponseHeadersEnforc ementFilter.java:238)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilte r.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.d oFilter(FilterHandler.java:131 )
at org.springframework.boot.actuate.trace.WebRequestTraceFilter