by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 04 10:36

    mmoayyed on 6.2.x

    Update U2FJpaConfiguration.java (compare)

  • Jul 03 10:00

    mergify[bot] on locustio-0.x

    (compare)

  • Jul 03 09:59
    mmoayyed closed #4889
  • Jul 03 07:58
    ilgrosso commented #4895
  • Jul 03 06:25

    mmoayyed on v6.1.7

    next release (compare)

  • Jul 03 06:24

    mmoayyed on v6.1.7

    (compare)

  • Jul 03 06:24

    mmoayyed on v6.1.7

    (compare)

  • Jul 03 06:18
    mmoayyed closed #4883
  • Jul 03 06:18

    mmoayyed on 6.1.x

    Make the RestTemplate externali… Force the trigger request to be… updates and 2 more (compare)

  • Jul 03 05:44

    mergify[bot] on gradle-6.x

    (compare)

  • Jul 03 05:44
    mmoayyed closed #4886
  • Jul 03 05:43

    mmoayyed on master

    renovatebot(deps): update depen… (compare)

  • Jul 03 05:43

    mmoayyed on idna-2.x

    (compare)

  • Jul 03 05:43
    mmoayyed closed #4888
  • Jul 03 05:31
    mmoayyed commented #4895
  • Jul 03 05:30

    apereocas-bot on gh-pages

    Published docs [gh-pages]. (compare)

  • Jul 03 05:29
    mmoayyed closed #4895
  • Jul 02 18:21

    mmoayyed on gh-pages

    Update Release-Process-63X.md (compare)

  • Jul 02 16:02
    codecov[bot] commented #4895
  • Jul 02 16:00
    codecov[bot] commented #4895
Cardo Kambla
@CardoKambla
I mentioned some time ago, that there is a problem with OAuth/OIDC /introspect request. When I get an access token from CAS and try to access some protected resource on my back-end, the /introspect request returns Unix Timestamp in seconds for issuedAt (iat) field (which is the expected behaviour) and expiresAt (exp) field has the configured value for accessTokens maxTimeToLiveInSeconds (default value 28800, which is not the expected behaviour, should also be unix timestamp). When Spring Security 5 tries to introspect the token, it sees that the expiredAt time is before the issued time and will throw a "IllegalArgumentException: expiresAt must be after issuedAt". When I checked the OAuth 2.0 token introspection standard, then it is stated that "exp" has to be of value "Integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire". TL:DR; OAuth/OIDC /introspect requests response value for expiresAt (exp) should be issuedAt + maxTimeToLiveInSeconds unix timestamp, currently it is just the maxTimeToLiveInSeconds value from CAS configuration.
This problem exists in version 6.2.0-SNAPSHOT and the resource server I am using for my back-end is Spring Security 5 OAuth2ResourceServer for introspection.
Cardo Kambla
@CardoKambla
I am gonna make a pull request on this but I still have not been able to test it yet, so it is gonna take some time for me until I get the pull request up.
Łukasz
@lgwozniak
I need to get to the site 'forgot password' directly, not from the login page. Is there any change to do that ?
chance*
pvemi
@vphanibhushanreddy
Has anyone ran in to this ? Am on CAS v 6.1.2 and Java 11
Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/templates/saml2-post-binding.vm'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:474)
Cardo Kambla
@CardoKambla
OIDC /revoke requests seems to get "javax.persistence.TransactionRequiredException: Executing an update/delete query" when it tries to delete a ticket. There is a transactional annotation present in that class. Update requests seem to be working because the tickets are added to the database.
JackieTang
@tanghaojie
audit config?
any audit database config example?
Cardo Kambla
@CardoKambla
I am using JPA ticket registry and a Postgres database, DDL is set to update.
Tables for ticket registry are created from startup and filled/selected when introspecting/asking access tokens.
Cardo Kambla
@CardoKambla
Stacktrace
2020-01-02 13:55:13,622 ERROR [org.apereo.cas.oidc.web.controllers.token.OidcRevocationEndpointController] - <Executing an update/delete query>
javax.persistence.TransactionRequiredException: Executing an update/delete query
at org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:409) ~[hibernate-core-5.4.10.Final.jar!/:5.4.10.Final]
at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1601) ~[hibernate-core-5.4.10.Final.jar!/:5.4.10.Final]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:409) ~[spring-orm-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at com.sun.proxy.$Proxy307.executeUpdate(Unknown Source) ~[?:?]
at org.apereo.cas.ticket.registry.JpaTicketRegistry.deleteSingleTicket(JpaTicketRegistry.java:209) ~[cas-server-support-jpa-ticket-registry-6.2.0-SNAPSHOT.jar!/:6.2.0-SNAPSHOT]
at org.apereo.cas.ticket.registry.AbstractTicketRegistry.deleteTicket(AbstractTicketRegistry.java:120) ~[cas-server-core-tickets-api-6.2.0-SNAPSHOT.jar!/:6.2.0-SNAPSHOT]
at org.apereo.cas.ticket.registry.AbstractTicketRegistry.deleteTicket(AbstractTicketRegistry.java:103) ~[cas-server-core-tickets-api-6.2.0-SNAPSHOT.jar!/:6.2.0-SNAPSHOT]
at org.apereo.cas.ticket.registry.AbstractTicketRegistryFastClassBySpringCGLIBFastClassBySpringCGLIBd3c67a11.invoke(<generated>) ~[cas-server-core-tickets-api-6.2.0-SNAPSHOT.jar!/:6.2.0-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:685) ~[spring-aop-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.apereo.cas.ticket.registry.JpaTicketRegistryEnhancerBySpringCGLIBEnhancerBySpringCGLIBe04acf1c.deleteTicket(<generated>) ~[cas-server-support-jpa-ticket-registry-6.2.0-SNAPSHOT.jar!/:6.2.0-SNAPSHOT]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:499) ~[spring-cloud-context-2.2.1.RELEASE.jar!/:2.2.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.2.RELEASE.jar!/:5.2.2.RELEASE]
at com.sun.proxy.$Proxy163.deleteTicket(Unknown Source) ~[?:?]
at org.apereo.cas.oidc.web.controllers.token.OidcRevocationEndpointController.handleRequestInternal(OidcRevocationEndpointController.java:68) ~[cas-server-support-oidc-core-api-6.2.0-SNAPSHOT.jar!/:6.2.0-SNAPSHOT]
Alberto Perillo
@perillo3ro
@infinity202 thanks for the docs. but I have CAS 6.1 (not 5.1) and it sems that it isn't work in the same way
And I don't understand this
"Support is enabled by adding the following module into the Maven overlay:"
In which file I have to add that?
Cardo Kambla
@CardoKambla
maven configuration goes into pom.xml file
CAS uses gradle afaik, you should be able to add the same dependency in gradle also
Cardo Kambla
@CardoKambla
@perillo3ro if you want to add a service from JSON (with overlay method):
0.1 Add dependency to gradle file under dependencies -> implementation "org.apereo.cas:cas-server-support-json-service-registry:${project.'cas.version'}"
0.2 Clean build CAS
  1. Create a json file
  2. Add data to that json file (from documentation)
  3. Add/replace that json file to your /etc/cas/services folder ( gradlew copyCasConfiguration does not copy it )
  4. In your cas.properties file check that cas.serviceRegistry.json.location is pointing toward that folder where the json is ( in my case file:/etc/cas/services)
  5. Also in cas.properties put cas.serviceRegistry.initFromJson=true .
  6. gradlew copyCasConfiguration
  7. run CAS
Alberto Perillo
@perillo3ro
Thanks, i'll try this
pvemi
@vphanibhushanreddy
@tanghaojie cas.ticket.registry.jpa.user=portaldb_user
cas.ticket.registry.jpa.password=test123$
cas.ticket.registry.jpa.driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
cas.ticket.registry.jpa.url=jdbc:sqlserver://10.10.1.40
cas.ticket.registry.jpa.dialect=org.hibernate.dialect.SQLServer2012Dialect
cas.ticket.registry.jpa.failFastTimeout=1
cas.ticket.registry.jpa.healthQuery=SELECT 1
cas.ticket.registry.jpa.isolateInternalQueries=false
cas.ticket.registry.jpa.leakThreshold=10
cas.ticket.registry.jpa.batchSize=100
cas.ticket.registry.jpa.ddlAuto=update
cas.ticket.registry.jpa.defaultSchema=portaldb
cas.ticket.registry.jpa.ticketLockType=NONE
cas.ticket.registry.jpa.jpaLockingTimeout=3600
Scott Williams
@vwbusguy
Is there any way to limit the users that are evaluated by risk based adaptive triggering? It ended up causing massive Mongo database load when enabled that effectively DOS'd the CAS service (6.1)
Philipp Berger
@philippberger

Hi all, we are currently using CAS 5.3.14 and facing the issue that our implementation of org.apereo.services.persondir.IPersonAttributeDao is called on every creation of a ProxyGrantingTicket. For me it looks like org.apereo.cas.audit.AuditableExecution.execute(AuditableContext) leads to org.apereo.cas.authentication.principal.cache.AbstractPrincipalAttributesRepository.retrievePersonAttributesToPrincipalAttributes(String) which is called for any service url. Is this the intended behavior?

Any comments on that? We are still facing the issue...

Alberto Perillo
@perillo3ro
@CardoKambla I put that in build.gradle and get this error

FAILURE: Build failed with an exception.

  • Where:
    Build file '/root/cas-6.1.x/build.gradle' line: 46

  • What went wrong:
    A problem occurred evaluating root project 'cas-server'.

    Could not get unknown property 'cas.version' for root project 'cas-server' of type org.gradle.api.Project.

Mikel
@mikelasla
Hi @mmoayyed. Have you had time to look at the Password Management feature on 6.0 ? (talking about ldap/ad type)
Misagh Moayyed
@mmoayyed
@mikelasla no, dont think I'd have time any time soon. If you need assistance, please contact me privately and we can work something out.
Cardo Kambla
@CardoKambla
@perillo3ro what OS are you using ?
is there any way to use CAS protocol to authenticate users for back-end microservices? it seems that CAS protocol only authenticates front-end web-clients
Cardo Kambla
@CardoKambla
the spring security post about Spring Boot and CAS usage does not mention it because Spring Boot is used as a monolith
matrixbot
@matrixbot
pratyushtiwari "+{sfs}+"
Alberto Perillo
@perillo3ro
@CardoKambla I put the compile line in the wrong place. Now CAS compiles. but when I make a .war and deploy it, i can't see the .jars in the lib folder. Maybe I making something wrong. but apparently it compiles. Thanks! :)
dev-cr-ka
@dev-cr-ka
Greating. I have found an issue and don't know, if it is a bug or intended.
I added ldap and keycloak via org.apereo.cas:cas-server-support-openid-webflow:${project.'cas.version'} and org.apereo.cas:cas-server-support-ldap:${project.'cas.version'}. That works. But as soon as I add org.apereo.cas:cas-server-support-oauth-webflow:${project.'cas.version'} to add OAuth communication for my client, this breaks keycloak (and any other pac4j service, like Google OAuth). Anyone ever heard of this?
Robert Witkowski
@witek1902

Hi! I want to logout user from CAS using REST endpoint. My users log in using OAuth2 so I created method which clear ticket registry:

private boolean ticketMatchesToSsoId(String ssoId, Ticket ticket) {
        Authentication auth = null;

        if (ticket instanceof TicketGrantingTicket) {
            auth = ((TicketGrantingTicket) ticket).getAuthentication();
        } else if (ticket instanceof OAuthToken) {
            auth = ((OAuthToken) ticket).getAuthentication();
        }

        if (auth != null) {
            Map<String, Object> ticketsPrincipalAttributes = auth.getPrincipal().getAttributes();
            return attributesMatch(ticketsPrincipalAttributes, ssoId);
        }
        return false;
    }

But this solution does not work. Maybe I can call internal CAS method which do all things for me?

jeanfpoulin
@jeanfpoulin

Hoping someone can help me figure out how to modify the CAS protocol response for service Validate endpoint example:

<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
<cas:authenticationSuccess>
<cas:user>username</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>

I want to change which cas attribute gets used for the username based on the service and add some of the other attributes in the response as well. Any ideas?

Scott Williams
@vwbusguy
Elasticsearch would be an interesting option for tracking CAS Events and would probably offer better performance for risk-based triggering than current options
Cardo Kambla
@CardoKambla
@dev-cr-ka what version of CAS are you using and what stacktrace do you get?
@witek1902 make a request to logout endpoint and it should remove the cookies
@witek1902 if you are using OAuth2 to log in a user, then I recommend you use OpenID Connect protocol which is basically OAuth2 with more user functionality and ability to log out
Cardo Kambla
@CardoKambla
@witek1902 here is the information about CAS acting as a OIDC authorization server https://apereo.github.io/cas/development/installation/OIDC-Authentication.html there are endpoints explained, I recommend you to test them through with Postman
they might be promblematic with database implementation but cache solutions should work nicely
Cardo Kambla
@CardoKambla
@vwbusguy everything comes down to the requirements in the end, elasticsearch at the beginning might seem a little over the edge when cache solutions are all you need at first. As much as I have used CAS, the database solutions still have some problems.
Scott Williams
@vwbusguy
Elasticsearch makes sense for stuff like risk based triggering. If you're going to use mongo for that, you either need to shard the collection or manually prune it and mongo will still be faster than JPA.
dev-cr-ka
@dev-cr-ka

@CardoKambla I am using CAS 6.1.3 I get the exception:
org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.apereo.cas.web.flow.DelegatedClientAuthenticationAction@18c4c2b in state 'delegatedAuthenticationAction' of flow 'login' -- action execution attributes were 'map[[empty]]' [...] Caused by: org.pac4j.core.exception.TechnicalException: State parameter is different from the one sent in authentication request. Session expired or possible threat of cross-site request forgery This is thrown in the OidcExtractor on line 68, because the context.getSessionStore() is empty.

I set logging level debug for pac4j, this is what I get right before the exception:
2020-01-15 08:08:34,801 DEBUG [org.pac4j.oidc.redirect.OidcRedirectionActionBuilder] - <Authentication request url: https://url.com/auth/realms/xyz/protocol/openid-connect/auth?scope=openid+profile+email&response_type=code&redirect_uri=redir_uri&state=TST-1-abc&nonce=myNonce&client_id=client> 2020-01-15 08:08:40,959 DEBUG [org.pac4j.oidc.credentials.extractor.OidcExtractor] - <Authentication response successful> 2020-01-15 08:08:40,970 ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] - <Forwarding to error page from request [/login] due to exception [Exception thrown executing org.apereo.cas.web.flow.DelegatedClientAuthenticationAction@36a20854 in state 'delegatedAuthenticationAction'... (see above)
The authentication itself works, but on redirect, the session isn't recognized (even though the session cookie in the browser).

When I use cas-server-support-pac4j-webflow without cas-server-support-oauth-webflow it works fine, so it's not a misconfiguration (I guess). In the code above I am using keycloak, but when setting up Google, I get the same behavior.

onsjkm
@onsjkm
Hello I am adding a new @Controller to cas overlay project and inside it I am trying to get Authenticated User attributes. Anyone knows how?
This i my controller:

@Slf4j
@Controller("profileController")
@RequestMapping
public class ProfileController {

@Autowired
private TicketRegistrySupport ticketRegistrySupport;

@GetMapping("/user")
@PreAuthorize("isAuthenticated()")
public String user(Model model, Principal principal) {

    // This is not working
    // model.addAttribute("principal", principal);
    return "shipUserProfile";
}

}