Hello Ray,

  

Thank you for you answer, I'm sorry for the delay in replying.

  

>> >> Luis

>> >> if I try to call the actuator like this (don't know if it's the right 
way),

>> >> 

>> >> 
https://localhost:8443/cas/actuator/releaseAttributes?username=ABExyz&password=somepassword&service=casdemo665

>> >> 

>> >> I get the following information on CAS server log:

>> >> 

>> >> 2023-04-21 15:11:09,619 [https-jsse-nio-8443-exec-2] ERROR: Service 
unauthorized

>> >>     
RegisteredServiceAccessStrategyAuditableEnforcer.java:lambda$execute$6:200

>> >>     Optional.java:orElseGet:364

>> >>     RegisteredServiceAccessStrategyAuditableEnforcer.java:execute:194

 

>> Ray

>> Put cas management aside while you work with the actuators for cas.

 

I referenced the use of CAS server actuators because it seems to me that 
some of CAS management functionalities call CAS server actuators under the 
hood.

 

I base this opinion on this information:

 

>> 
https://groups.google.com/a/apereo.org/g/cas-user/c/crOUxHaXh_k/m/ZTPDH5kwAAAJ

>> 

>> The "dashboard" and "CAS Info" tabs of the 
https://my-domain/cas-management/dashboard 

>> are now populated with data coming from my CAS server /health and /info 
actuators.

 

I think, don’t know for sure, that as some CAS management information comes 
from CAS server actuators, like /health and /info, so does the attribute 
release information must come from the same source, CAS server actuators.

  

If my analysis with Chrome DevTools is correct, the following happens when 
calling, for example:

  

CAS management => Administration => Resolve Attributes

GET https://localhost:8445/cas-management/api/dashboard/resolve/<username>

 

This option works fine. I think that under the hood it calls this CAS 
server actuator, 
https://apereo.github.io/cas/6.6.x/integration/Attribute-Resolution.html#actuator-endpoints

 

 

CAS management => Administration => Release Attributes

POST https://localhost:8445/cas-management/api/dashboard/release

 

This option causes the “403” mentioned error.

 

POST does exist as an actuator endpoint, as stated here,

https://apereo.github.io/cas/6.6.x/integration/Attribute-Release-Policies.html#actuator-endpoints

but I’m not sure if this functionality should make a POST (POST inside cas 
management, it’s true, I could not find out what kind of request is made 
from CAS management to CAS server), I think I should make a GET, does this 
makes sense?

Is it possible that CAS management should make a GET instead of a POST on 
this functionality and this is a bug?

 

  

>> Ray

>> You can edit the json service definition by hand if needed.

 I've been doing that, editting my json files, but right now my goal is to 
test CAS management, because, as the documentation below states, when I use 
other backend (not JSON Service Registry), which I plan to do, I will need 
do use CAS management, so I’m testing all it’s options.

 

>> CAS Management Web Application / Installing-ServicesMgmt-Webapp.md

>> 
https://github.com/apereo/cas-management/blob/6.6.x/docs/cas-mgmt-documentation/installation/Installing-ServicesMgmt-Webapp.md#cas-management-web-application

>> ...

>> Synchronized Configuration

>> ...

>> Note that for certain type of service registry backends, 

>> deploying the management web application is a requirement 

>> since it acts as the interface fronting CRUD operations 

>> that deal with the storage backend. 

>> The absence of the management web application 

>> means that you will need to find alternative tooling 

>> to manually interact with your registry of choice 

>> and the storage backend it employs.

 

  

>> Ray

>> You say there is a problem with cas management release attributes 

>> but the url provided suggests you are accessing cas.

 As I said above, based on info I’ve read on CAS google group, I think, not 
sure if I’m right, that cas management release attributes info is obtained 
from CAS server by calling an actuator, probably one of these:

 
https://apereo.github.io/cas/6.6.x/integration/Attribute-Release-Policies.html#actuator-endpoints

 

  

>> Ray

>> This is my local endpoint config:

 

##### --- management endpoints

# cas.monitor.endpoints.ldap.ldap-authz.role-attribute = description

management.endpoints.enabled-by-default=true

 

Luis: I also have this setting on cas.properties 

 

 

management.endpoint.metrics.enabled=true

management.endpoint.env.enabled=true

management.endpoint.configurationMetadata.enabled=true

# # curl -X POST -k https://local.uvic.ca/cas/actuator/refresh was accepted 
but browser refresh -> 500

# # management.endpoint.refresh.enabled=true

# # not sure how to call

# # management.endpoint.autoconfig.enabled=true

 

# default:

# health,info

# cas built in (or part of already configured features), enabled with '*' 
(some may not work):

# 
samlValidate,yubikeyAccountRepository,loggingConfig,beans,caches,conditions,configprops,env,loggers,heapdump,threaddump,metrics,scheduledtasks,mappings,refresh,features

# cas-server-support-reports, status is auto enabled, provides:

# 
status,springWebflow,auditLog,registeredServices.exportRegisteredServices,ssoSession,statistics,releaseAttributes

# cas-server-core-configuration-metadata-repository configurationMetadata 
is auto enabled, provides:

# configurationMetadata

# cas-server-support-discovery-profile provides:

# discoveryProfile

management.endpoints.web.exposure.include=*

 

Luis: I also have this setting on cas.properties 

 

 

# https://apereo.github.io/2018/11/06/cas6-admin-endpoints-security/

# must specify auto enabled / default endpoints if using exposure.include

# 
management.endpoints.web.exposure.include=health,info,configurationMetadata,discoveryProfile,auditLog

 

# # cas.monitor.endpoints.endpoint.defaults.access[0]=IP_ADDRESS

# # 
cas.monitor.endpoints.endpoint.defaults.requiredIpAddresses[0]=\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}

# # 
#cas.monitor.endpoints.endpoint.defaults.requiredIpAddresses[0]=127\\.0\\.0\\.1

 

# # shows free memory

# management.endpoint.health.show-details=always

# # shows health items below

# management.health.defaults.enabled=true

# # on by default

# # management.health.memoryHealthIndicator.enabled=true

# # management.health.systemHealthIndicator.enabled=true

# # management.health.sessionHealthIndicator.enabled=true

# # management.health.hazelcastHealthIndicator.enabled=true

# # 
management.health.pooledLdapConnectionFactoryHealthIndicator.enabled=true

# # 
management.health.samlRegisteredServiceMetadataHealthIndicator.enabled=true

 

management.endpoint.ticketExpirationPolicies.enabled=true

 

Luis: I don’t have this config, think I don’t need it for my CAS management 
tests

 

 

management.endpoints.web.exposure.include=*

 

Luis: I also have this setting on cas.properties, it’s duplicated on this 
config

 

 

# # can not be accessed once authenticated. I know, weird, right?

cas.monitor.endpoints.endpoint.health.access=ANONYMOUS

# # cas.monitor.endpoints.endpoint.info.access=ANONYMOUS

 

# spring.security.user.name=casuser

spring.security.user.password=Some secret, spaces are cool

 

# cas.monitor.endpoints.endpoint.defaults.access=AUTHENTICATED

cas.monitor.endpoints.endpoint.defaults.access=ANONYMOUS

  

Luis: for now I have all actuator access ANONYMOUS, for testing purposes

Luis: cas.monitor.endpoints.endpoint.defaults.access=ANONYMOUS


Luis:

What makes me think that my "CAS management => Administration => Release 
Attributes" “403” problem might be a bug is:

-all other CAS management features that I’ve tested work fine (eg Manage 
Services, Resolve Attributes)

-couldn’t find anybody on this group stating that it can use this feature 
correctly on cas management 6.6.2

 

Does my above reasoning make sense?



A segunda-feira, 24 de abril de 2023 à(s) 17:44:20 UTC+1, Ray Bon escreveu:

Luís,

Put cas management aside while you work with the actuators for cas. You can 
edit the json service definition by hand if needed.
You say there is a problem with cas management release attributes but the 
url provided suggests you are accessing cas.

Ray

This is my local endpoint config:

##### --- management endpoints
# cas.monitor.endpoints.ldap.ldap-authz.role-attribute = description
management.endpoints.enabled-by-default=true

management.endpoint.metrics.enabled=true
management.endpoint.env.enabled=true
management.endpoint.configurationMetadata.enabled=true
# # curl -X POST -k https://local.uvic.ca/cas/actuator/refresh was accepted 
but browser refresh -> 500
# # management.endpoint.refresh.enabled=true
# # not sure how to call
# # management.endpoint.autoconfig.enabled=true

# default:
# health,info
# cas built in (or part of already configured features), enabled with '*' 
(some may not work):
# 
samlValidate,yubikeyAccountRepository,loggingConfig,beans,caches,conditions,configprops,env,loggers,heapdump,threaddump,metrics,scheduledtasks,mappings,refresh,features
# cas-server-support-reports, status is auto enabled, provides:
# 
status,springWebflow,auditLog,registeredServices.exportRegisteredServices,ssoSession,statistics,releaseAttributes
# cas-server-core-configuration-metadata-repository configurationMetadata 
is auto enabled, provides:
# configurationMetadata
# cas-server-support-discovery-profile provides: 
# discoveryProfile
management.endpoints.web.exposure.include=*
# https://apereo.github.io/2018/11/06/cas6-admin-endpoints-security/
# must specify auto enabled / default endpoints if using exposure.include
# 
management.endpoints.web.exposure.include=health,info,configurationMetadata,discoveryProfile,auditLog

# # cas.monitor.endpoints.endpoint.defaults.access[0]=IP_ADDRESS
# # 
cas.monitor.endpoints.endpoint.defaults.requiredIpAddresses[0]=\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}
# # 
#cas.monitor.endpoints.endpoint.defaults.requiredIpAddresses[0]=127\\.0\\.0\\.1

# # shows free memory
# management.endpoint.health.show-details=always
# # shows health items below
# management.health.defaults.enabled=true
# # on by default
# # management.health.memoryHealthIndicator.enabled=true
# # management.health.systemHealthIndicator.enabled=true
# # management.health.sessionHealthIndicator.enabled=true
# # management.health.hazelcastHealthIndicator.enabled=true
# # 
management.health.pooledLdapConnectionFactoryHealthIndicator.enabled=true
# # 
management.health.samlRegisteredServiceMetadataHealthIndicator.enabled=true

management.endpoint.ticketExpirationPolicies.enabled=true
management.endpoints.web.exposure.include=*

# # can not be accessed once authenticated. I know, weird, right?
cas.monitor.endpoints.endpoint.health.access=ANONYMOUS
# # cas.monitor.endpoints.endpoint.info.access=ANONYMOUS

# spring.security.user.name=casuser
spring.security.user.password=Some secret, spaces are cool

# cas.monitor.endpoints.endpoint.defaults.access=AUTHENTICATED
cas.monitor.endpoints.endpoint.defaults.access=ANONYMOUS


On Fri, 2023-04-21 at 07:17 -0700, Luís Costa wrote:

Notice: This message was sent from outside the University of Victoria email 
system. Please be cautious with links and sensitive information.


Hello,


I've recently installed "CAS server 665 and "CAS management 662".

I've configured all of CAS server actuators to be available with ANONYMOUS 
access (for initial testing purposes).

I think I've included all the needed dependencies in both "CAS server and 
"CAS managment.

I'm using JSON service registry for testing purposes, and I have one 
service configured, which is correctly recognized by CAS management.

CAS management is apparently working well on almoust all options i've 
tested, as an example, I can change my service JSON file configs with CAS 
management.

I've also been able to successefully test "CAS management => Administration 
=> RESOLVE Attributes".


I'm having the following error when testing option "CAS management => 
Administration => RELEASE Attributes" with the above configured service:


CAS management log:

2023-04-19 18:46:52,618 [https-jsse-nio-8445-exec-2] ERROR: 403 : 
"<Map><timestamp>2023-04-19T17:46:52.365+00:00</timestamp><status>403</status><error>Forbidden</error><trace>org.apereo.cas.services.UnauthorizedSsoServiceException:
service.not.authorized.sso<EOL>?
at 
org.apereo.cas.authentication.handler.RegisteredServiceAuthenticationHandlerResolver.supports(RegisteredServiceAuthenticationHandlerResolver.java:122)<EOL>?
at 
org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan.lambda$getAuthenticationHandlers$4(DefaultAuthenticationEventExecutionPlan.java:161)<EOL>?
(...)
at 
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)<EOL>?at
 
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)<EOL>?
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)<EOL>?at
 
java.base/java.lang.Thread.run(Thread.java:833)<EOL></trace><path>/sso/actuator/releaseAttributes</path></Map>"
at 
org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:109)
at 
org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:168)
(...)
2023-04-19 18:46:52,654 [https-jsse-nio-8445-exec-2] ERROR: 
Servlet.service() for servlet [dispatcherServlet] in context with path 
[/cas-management] threw exception
java.lang.RuntimeException: 
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.lang.NullPointerException: Cannot invoke 
"org.apereo.cas.mgmt.domain.Attributes.getAttributes()" because the return 
value of "org.apereo.cas.mgmt.DashboardController.callCasServer(String, 
Object, org.springframework.core.ParameterizedTypeReference)" is null
at 
org.pac4j.core.engine.AbstractExceptionAwareLogic.runtimeException(AbstractExceptionAwareLogic.java:64)
at 
org.pac4j.core.engine.AbstractExceptionAwareLogic.handleException(AbstractExceptionAwareLogic.java:49)
at 
org.pac4j.core.engine.DefaultSecurityLogic.perform(DefaultSecurityLogic.java:163)
(...)
Caused by: org.springframework.web.util.NestedServletException: Request 
processing failed; nested exception is java.lang.NullPointerException: 
Cannot invoke "org.apereo.cas.mgmt.domain.Attributes.getAttributes()" 
because the return value of 
"org.apereo.cas.mgmt.DashboardController.callCasServer(String, Object, 
org.springframework.core.ParameterizedTypeReference)" is null
at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at 
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:517)
Caused by: java.lang.NullPointerException: Cannot invoke 
"org.apereo.cas.mgmt.domain.Attributes.getAttributes()" because the return 
value of "org.apereo.cas.mgmt.DashboardController.callCasServer(String, 
Object, org.springframework.core.ParameterizedTypeReference)" is null
at 
org.apereo.cas.mgmt.DashboardController.release(DashboardController.java:170)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
(...)


CAS server log:

2023-04-20 18:04:53,974 [https-jsse-nio-8443-exec-3] WARN : Service 
[AbstractWebApplicationService(id=casdemo665, originalUrl=casdemo665, 
artifactId=null, principal=null, source=service, loggedOutAlready=false, 
format=XML, attributes={service=[casdemo665], username=[ABExyz]})] is not 
allowed to use SSO.

2023-04-20 18:04:53,975 [https-jsse-nio-8443-exec-3] INFO : Audit trail 
record BEGIN
=============================================================
WHO: ABE001731
WHAT: [UsernamePasswordCredential(username=ABE001731, source=null, 
customFields={})]
ACTION: AUTHENTICATION_FAILED
APPLICATION: CAS
WHEN: Thu Apr 20 18:04:53 WEST 2023
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================


If I try to call the actuator like this (don't know if it's the right way),

https://localhost:8443/cas/actuator/releaseAttributes?username=ABExyz&password=somepassword&service=casdemo665

I get the following information on CAS server log:

2023-04-21 15:11:09,619 [https-jsse-nio-8443-exec-2] ERROR: Service 
unauthorized
RegisteredServiceAccessStrategyAuditableEnforcer.java:lambda$execute$6:200
Optional.java:orElseGet:364
RegisteredServiceAccessStrategyAuditableEnforcer.java:execute:194


I've tried to use "CAS server 665 and "CAS management 661", which I think, 
looking at "CAS management 661" dependencies, makes more sense,
but with this configuration, CAS management gets worse, for example, I 
can't manage by service JSON file base configs (get a blank screen),
so I've got back to "CAS server 665 and "CAS management 662", on which my 
only problem so far is with "CAS management => Administration => RESOLVE 
Attributes".


My questions:
-Am I missing some configuration on properties files of CAS server and/or 
CAS management?
-Am I missing some configuration on JSON file of my casdemo665 service?
-Is there a known issue with "CAS server 665 + CAS management 6.6.2" on 
"CAS management => Administration => RESOLVE Attributes"?


Can anybody help me with this issue, please?

-- 
- 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+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/c71bf722-afad-4206-96cf-8f0b92778bd1n%40apereo.org.

Reply via email to