CAS 7.1 Configuration Issue: Denied Access to Moodle Service

223 views
Skip to first unread message

Agnieszka Żywiec

unread,
May 30, 2024, 2:13:44 PM5/30/24
to CAS Community

Hi,

I am trying to set up federated login for Moodle using CAS 7.1. However, I am encountering an Unauthorized Service Exception error when attempting to log into Moodle.

x.PNG

ehhhhhhhhhhhhh.PNG

I am using CasRegisteredService to configure the service for Moodle. Below are configurations I tried:

 ehhhhhhhh.PNG

ehhhhhh.PNG

Error logs, that might be relevant:

2024-05-30 18:56:55,931 ERROR [org.apereo.cas.web.support.filters.AbstractSecurityFilter] - <Unauthorized

        UnauthorizedServiceException.java:denied:56

        RegisteredServiceAccessStrategyAuditableEnforcer.java:lambda$execute$6:200

        Optional.java:orElseGet:364

> 

2024-05-30 18:56:55,932 ERROR [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/cas].[dispatcherServlet]] - <Servlet.service() for servlet [dispatcherServlet] in context with path [/cas] threw exception>

org.apereo.cas.services.UnauthorizedServiceException: Unauthorized

        at org.apereo.cas.services.UnauthorizedServiceException.denied(UnauthorizedServiceException.java:56)

        at org.apereo.cas.services.RegisteredServiceAccessStrategyAuditableEnforcer.lambda$execute$6(RegisteredServiceAccessStrategyAuditableEnforcer.java:200)

        at java.base/java.util.Optional.orElseGet(Optional.java:364)

        at org.apereo.cas.services.RegisteredServiceAccessStrategyAuditableEnforcer.execute(RegisteredServiceAccessStrategyAuditableEnforcer.java:194)

        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

        at java.base/java.lang.reflect.Method.invoke(Method.java:580)

        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)

        at org.apereo.inspektr.audit.AuditTrailManagementAspect.handleAuditTrail(AuditTrailManagementAspect.java:129)

        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

        at java.base/java.lang.reflect.Method.invoke(Method.java:580)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:173)

        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)

        at jdk.proxy2/jdk.proxy2.$Proxy184.execute(Unknown Source)

        at org.apereo.cas.services.web.support.RegisteredServiceResponseHeadersEnforcementFilter.prepareFilterBeforeExecution(RegisteredServiceResponseHeadersEnforcementFilter.java:83)

        at org.apereo.cas.web.support.filters.ResponseHeadersEnforcementFilter.doFilter(ResponseHeadersEnforcementFilter.java:181)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)



I am looking for assistance in identifying why the Unauthorized Service Exception is being thrown. Is there anything wrong with my configuration?

 Regards,

 

Misagh

unread,
May 30, 2024, 2:15:15 PM5/30/24
to cas-...@apereo.org
Goto regex101.com, punch your pattern there, and give it the service
URL. You'll see the failure. Your pattern forces a port number.

On Thu, May 30, 2024 at 10:13 PM Agnieszka Żywiec <aga.z...@gmail.com> wrote:
>
> Hi,
>
> I am trying to set up federated login for Moodle using CAS 7.1. However, I am encountering an Unauthorized Service Exception error when attempting to log into Moodle.
>
>
>
> I am using CasRegisteredService to configure the service for Moodle. Below are configurations I tried:
>
>
>
>
> --
> - Website: https://apereo.github.io/cas
> - Gitter Chatroom: https://gitter.im/apereo/cas
> - List Guidelines: https://goo.gl/1VRrw7
> - Contributions: https://goo.gl/mh7qDG
> ---
> You received this message because you are subscribed to the Google Groups "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
> To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/94cecec9-e200-4413-86e6-4781cd15d409n%40apereo.org.
Reply all
Reply to author
Forward
0 new messages