Giter Site home page Giter Site logo

cas-openid-demo's Introduction

Introduction

CAS in the cloud is a full-stacked project to deploy your CAS server in the cloud.

It is based on the CAS server (and CAS management webapp) v5.0.

The tickets are handled via Memcached and the services are defined as JSON files.

Everything is dockerized for the cloud.

Installation

Hosts

You need to locally add the cas-server and cas-management hosts by updating your /etc/hosts/ file:

127.0.0.1     localhost     cas-server     cas-management

Build the CAS webapps

You can build the CAS webapps via the following command at the root directory: ./package.sh

Launch CAS in the cloud

You can run the CAS stack using the following command at the root directory: docker-compose up.

The CAS server is available on the following URL: http://cas-server:8080/login. You can login using leleuj/leleuj or jleleu/jleleu, but of course, the default authentication handler MUST be changed.

The CAS management webapp is available on the following URL: http://cas-management:8081.

cas-openid-demo's People

Contributors

leleuj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cas-openid-demo's Issues

org.jasig.cas:cas-server-core-authentication 301 Moved Permanently

Hi Leleuj

Wanted to test your application out but when I run mvn package after cleaning, it throws the following error:
Project ID: org.jasig.cas:cas-server-core-authentication Reason: Error getting POM for 'org.jasig.cas:cas-server-core-authentication' from the repository: Unable to read local copy of metadata: Cannot read metadata from '/root/.m2/repository/org/jasig/cas/cas-server-core-authentication/4.3.0-SNAPSHOT/maven-metadata-jasig-legacy.xml': end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... @6:8) org.jasig.cas:cas-server-core-authentication:pom:4.3.0-SNAPSHOT for project org.jasig.cas:cas-server-core-authentication

This is of because the maven-metadata-jasig-legacy.xml file contains HTML explaining that the repo has moved permanently.

No qualifying bean of type [org.jasig.cas.authentication.principal.PrincipalFactory] found for dependenc

No qualifying bean of type [org.jasig.cas.authentication.principal.PrincipalFactory] found for dependency
when I run it, the server failed. In client-demo, I execute

mvn jetty:run

The log from jetty console as following

[main] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'com.codahale.metrics.health.HealthCheckRegistry#0' of type [class com.codahale.metrics.health.HealthCheckRegistry] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[main] INFO org.jasig.cas.CasEnvironmentContextListener -
******************** Welcome to CAS *******************
CAS Version: 4.2.0-RC2
Build Date/Time: 2016-01-30T03:34:32.000+08:00
Java Home: C:\Program Files\Java\jdk1.8.0_66\jre
Java Vendor: Oracle Corporation
Java Version: 1.8.0_66
OS Architecture: amd64
OS Name: Windows 10
OS Version: 10.0
*******************************************************

[main] INFO org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor
[main] INFO org.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
[main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.2.1 created.
[main] INFO org.quartz.simpl.RAMJobStore - RAMJobStore initialized.
[main] INFO org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.2.1) 'scheduler' with instanceId 'NON_CLUSTERED'
  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
  Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

[main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'scheduler' initialized from an externally provided properties instance.
[main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.2.1
[main] INFO org.quartz.core.QuartzScheduler - JobFactory set to: org.jasig.cas.util.CasSpringBeanJobFactory@10164e94
[main] INFO org.jasig.cas.services.DefaultServicesManagerImpl - Loaded 3 services from JsonServiceRegistryDao.
[main] INFO org.jasig.cas.services.DefaultServicesManagerImpl - Services manager will reload service definitions every 60 seconds
[main] INFO org.jasig.cas.ticket.registry.DefaultTicketRegistry - Preparing to schedule job to clean up after tickets...
[main] INFO org.jasig.cas.ticket.registry.DefaultTicketRegistry - DefaultTicketRegistry will clean tickets every 2 minutes
[main] WARN org.springframework.web.context.support.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.jasig.cas.AbstractCentralAuthenticationService.setPrincipalFactory(org.jasig.cas.authentication.principal.PrincipalFactory); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.cas.authentication.principal.PrincipalFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=principalFactory)}
[main] INFO org.springframework.scheduling.quartz.SchedulerFactoryBean - Shutting down Quartz Scheduler
[main] INFO org.quartz.core.QuartzScheduler - Scheduler scheduler_$_NON_CLUSTERED shutting down.
[main] INFO org.quartz.core.QuartzScheduler - Scheduler scheduler_$_NON_CLUSTERED paused.
[org.jasig.cas.services.JsonServiceRegistryDao] WARN org.jasig.cas.services.JsonServiceRegistryConfigWatcher - Directory key is no longer valid. Quitting watcher service
[main] INFO org.quartz.core.QuartzScheduler - Scheduler scheduler_$_NON_CLUSTERED shutdown complete.
[main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.jasig.cas.AbstractCentralAuthenticationService.setPrincipalFactory(org.jasig.cas.authentication.principal.PrincipalFactory); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.cas.authentication.principal.PrincipalFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=principalFactory)}
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:771)
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:411)
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:247)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1238)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:480)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
        at org.eclipse.jetty.server.Server.doStart(Server.java:277)
        at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
        at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
        at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:516)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.jasig.cas.AbstractCentralAuthenticationService.setPrincipalFactory(org.jasig.cas.authentication.principal.PrincipalFactory); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.cas.authentication.principal.PrincipalFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=principalFactory)}
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
        ... 55 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.cas.authentication.principal.PrincipalFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=principalFactory)}
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:618)
        ... 57 more

Add jetty:run as an option to test with

Hi, this looks very useful.

But it would be great if it were simpler to try out.
Perhaps making the server and client able to start with: mvn jetty:run would be helpful to try this out quickly.

Some more instructions on how to use this would also be helpful.

Dependencies missing in the central repostitory

opensaml1 artifact version 1.1b is not available and guice 2.0 is not available in the maven central repository

    <dependency>
        <groupId>org.jasig.cas</groupId>
        <artifactId>cas-server-support-openid</artifactId>
        <version>${cas.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.google.code.guice</groupId>
                <artifactId>guice</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.opensaml</groupId>
        <artifactId>opensaml1</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>2.0</version>
    </dependency>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.