Unauthorized Service Access when directing login page to cas from web app in apache server.

59 views
Skip to first unread message

irvan suryadi

unread,
Dec 28, 2020, 2:35:03 AM12/28/20
to CAS Community
Hi All,

I'm currently trying to develop cas on my localhost network. I'm currently trying to add a web application in the apache server as a client for SSO CAS. I try to follow directions like:

- Installing and configuring mod_auth_cas on my apache server.
- added a wildcard registry service (which I will attach below this message)

But after I run the application I get an error like : unauthorized Service Access. Service [ ] is not found in service registry.

Is there anything I missed? And to add a web app to cas are we needto install the cas management overlay?

Currently I am still trying to install the service manually.

--------------------
The following is a service registry file (HTTPSandIMAPSwildcard-1608903630.json in / etc / cas / services):

{
"@class": "org.apereo.cas.services.RegexRegisteredService",
"serviceId": "^ (https | imaps): //.*",
"name": "HTTPS and IMAPS wildcard",
"id": 1608903630,
"evaluationOrder": 99999
}
Screenshot from 2020-12-28 14-19-30.png

arti wavale

unread,
Dec 29, 2020, 1:41:27 AM12/29/20
to cas-...@apereo.org
Hello,

Check once CASValidateUrl and use Client_IP in  CASRootProxiedAs properties

try this service registry file:
------------------------------
{
  "@class" : "org.apereo.cas.services.RegexRegisteredService",
  "serviceId" : "^https://Client_IP/secured-by-cas(\\z|/.*)",
  "name" : "Apache Secured By CAS",
  "id" : 20191127030720,
  "description" : "CAS development Apache mod_auth_cas server with username/password protection",
  "attributeReleasePolicy" : {
    "@class" : "org.apereo.cas.services.ReturnAllAttributeReleasePolicy",
  },
  "evaluationOrder" : 1100
}
-------------------

Thanks and Regards
Arti

--
- 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/bf168b68-e084-4ff6-93bf-4ba65942d782n%40apereo.org.

irvan suryadi

unread,
Dec 30, 2020, 5:18:33 AM12/30/20
to CAS Community, arti wavale
Hi Arti,

I've tried ur recomendation, but its still not working.

Here's my error log :

2020-12-30 17:10:32,071 WARN [org.apereo.cas.util.RegexUtils] - <Pattern cannot be null/blank>
2020-12-30 17:10:32,326 WARN [javax.persistence.spi] - <javax.persistence.spi::No valid providers found.>
2020-12-30 17:10:32,368 WARN [org.apereo.cas.services.RegisteredServiceAccessStrategyUtils] - <Unauthorized Service Access. Service [] is not found in service registry.>

The log shows there is no valid providers, what kind of providers I need to use and how to use it?
and The Service is not found in the service registry but I've been created the service reqistry on my /etc/services

Any recomendation?

 Thanks,
Irvan 

Andy Ng

unread,
Dec 31, 2020, 1:43:05 AM12/31/20
to CAS Community, irvans...@gmail.com, arti wavale
Hi Irvan,

Please check if the following insight helps:
1. In order to use JSON as service registry, you need to enable it first using this https://apereo.github.io/cas/6.2.x/services/JSON-Service-Management.html#json-service-registry 
Put this in your build.gradle:
org.apereo.cas:cas-server-support-json-service-registry:${cas.version}

2. For the service path, do note that it needs to be at the root, so

Corret path is : /etc/cas/services
Correct path in Windows: C:/etc/cas/services
Not correct path: /opt/somedirectory/that/your/cas/is/installed/etc/cas/services

See if these works. thanks.

Cheers.
- Andy

irvan suryadi

unread,
Jan 2, 2021, 8:47:12 PM1/2/21
to CAS Community, Andy Ng, irvan suryadi, arti wavale
Hi Andy,

I've made sure that the requirements and steps I used before.

But I still can't use my application (unauthorized service) and got some error messages like "no valid providers found" and "service is not found".

Do I need to use a valid service provider? or is this just my fault in configuring the service?

Previously, thank you Andy for your response.

Cheers,
Irvan

Andy Ng

unread,
Jan 2, 2021, 10:02:41 PM1/2/21
to CAS Community, irvans...@gmail.com, Andy Ng, arti wavale
Hi Irvan,

Hmm... If so maybe you need to look into how to fix the "no valid provider found" issue, and maybe you actually need to fix that first.

In my implementation, I never saw that warning, so maybe that's is the issue you are encountering.

FYI, the "Pattern cannot be null/blank" is located here: https://github.com/apereo/cas/blob/v6.2.7/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/RegexUtils.java#L83, which indicate CAS cannot see your service pattern.

I am not familar with javax so see if other can add comment on what happens.

Cheers.
- Andy
Reply all
Reply to author
Forward
0 new messages