[cas-user] Re: Service Registry in MongoDB (with replication)

2019-11-14 Thread Shawn Cutting
I figured out the problem (several factors):
1. I changed the pom.xml file so that the cas version matched what I was 
using (it was 5.3.5, but I made it 5.3.14) -> Can't do that apparently.
2. I was not properly deleting the cas-management folder from the 
tomcat/webapps, and the updated jars created by the pom build were getting 
added to the webapps folder.

Once I set everything back to the original, and deleted the appropriate 
folder, it came up.  Ugh!
Thanks for your help!

Shawn

On Thursday, November 14, 2019 at 10:53:56 AM UTC-5, Shawn Cutting wrote:
>
> Good morning,
>
> I am at a total loss here about how to get CAS services to load from (and 
> to) MongoDB.  Following the instructions on David Curry's site 
>  
> (very well written, by the way), I have the mongodb server running and 
> replicating across 3 servers.  I am also able to successfully 
> auto-initialize the database with the JSON files.  I verify this by opening 
> mongodb and searching the collection "casServiceRegistry."
>
> *CAS version 5.3.14*, by the way.
>
> When I start the tomcat server and watch the debug logs, I see that CAS is 
> loading the entry from the database:
>
> - snippet -
> 2019-11-13 16:24:22,706 DEBUG 
> [org.apereo.cas.services.AbstractServicesManager] -  [org.apereo.cas.services.ChainingServiceRegistry@3971e14f]>
> 2019-11-13 16:24:22,728 DEBUG 
> [org.apereo.cas.services.AbstractServicesManager] -  service [http(|s)://cas(|.*).messiah.edu(|.*)/cas-management(|/.*)]>
> 2019-11-13 16:24:22,729 INFO 
> [org.apereo.cas.services.AbstractServicesManager] -  from [MongoDbServiceRegistry].>
>
>
> Here is where it gets weird: when I load the management app, I see one 
> service entry that does NOT match the one loaded on startup.  I should also 
> note that I have the ticket registry replicated on the same MongoDB server 
> and it works perfectly.
>
> That's the short story, here are the details (these settings match on all 
> 3 servers "*cas-ha01, cas-ha02, cas-ha03*":
>
> -- cas.properties: --
> cas.server.name=https://cas-ha.messiah.edu
> cas.server.prefix=${cas.server.name}/cas
> cas.view.templatePrefixes[0]=file:///etc/cas/templates
> cas.logout.followServiceRedirects=true
> logging.config=file:/etc/cas/config/log4j2.xml
>
> mongo.db=casdb
> mongo.rs=rs0
> mongo.opts==true
> mongo.creds=mongocas:**
> mongo.hosts=cas-ha01.messiah.edu,cas-ha02.messiah.edu,cas-ha03.messiah.edu
> # The connection string, assembled
> mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db}?replicaSet=${
> mongo.rs}${mongo.opts}
>
> ### Remove default/local users (must be left blank) ###
> cas.authn.accept.users=
>
> ### Service Registry Setup ###
> #cas.serviceRegistry.json.location=file:/etc/cas/services
> #cas.serviceRegistry.initFromJson=true
> cas.serviceRegistry.mongo.databaseName=${mongo.db}
> cas.serviceRegistry.mongo.clientUri=${mongo.uri}
> cas.serviceRegistry.mongo.collection=casServiceRegistry
> cas.serviceRegistry.mongo.replicaSet=${mongo.rs}
> cas.serviceRegistry.mongo.sslEnabled=true
> cas.ticket.registry.mongo.clientUri=${mongo.uri}
>
>
> -- management.properties: --
> cas.server.name=https://cas-ha.messiah.edu
> cas.server.prefix=${cas.server.name}/cas
> mgmt.serverName=${cas.server.name}
> mgmt.userPropertiesFile=file:/etc/cas/config/adminusers.properties
>
> mongo.db=casdb
> mongo.rs=rs0
> mongo.opts==true
> mongo.creds=mongocas:**
> mongo.hosts=cas-ha01.messiah.edu,cas-ha02.messiah.edu,cas-ha03.messiah.edu
> # The connection string, assembled
> mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db}?replicaSet=${
> mongo.rs}${mongo.opts}
>
> ### Service Registry Setup ###
> #cas.serviceRegistry.json.location=file:/etc/cas/services
> cas.serviceRegistry.mongo.clientUri=${mongo.uri}
> cas.serviceRegistry.mongo.collection=casServiceRegistry
>
> -- pom.xml (cas server, dependencies): --
> ...
> 
> org.apereo.cas
> cas-server-webapp${app.server}
> ${cas.version}
> war
> runtime
> 
> 
> org.apereo.cas
> cas-server-support-ldap
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-ldap-core
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-webapp-config-security
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-core
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-api
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-webflow
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-rest
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-gauth
> ${cas.version}
> 
> 
>org.apereo.cas
>cas-server-support-jdbc-drivers
>${cas.version}
> 
> 
>  org.apereo.cas
>  cas-server-support-gauth-jpa
>  ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-trusted-mfa
> ${cas.version}
> 
> 
>   

[cas-user] Re: Service Registry in MongoDB (with replication)

2019-11-14 Thread Shawn Cutting
 

Update:

 

I found something else out in trying to get this working.  If I *manually* 
add a service to MongoDB, I am able to access that service via CAS (this 
was verified by deleting the record and subsequently getting the 
"Application not allowed" message, re-adding it and being allowed again).

 

So it seems that the issue is with the management application, not the CAS 
server.  I need to be able to manage the MongoDB records with the service 
application, and that is not possible for some reason.

 

Thanks in advance for any help.

 

Shawn


On Thursday, November 14, 2019 at 10:53:56 AM UTC-5, Shawn Cutting wrote:
>
> Good morning,
>
> I am at a total loss here about how to get CAS services to load from (and 
> to) MongoDB.  Following the instructions on David Curry's site 
>  
> (very well written, by the way), I have the mongodb server running and 
> replicating across 3 servers.  I am also able to successfully 
> auto-initialize the database with the JSON files.  I verify this by opening 
> mongodb and searching the collection "casServiceRegistry."
>
> *CAS version 5.3.14*, by the way.
>
> When I start the tomcat server and watch the debug logs, I see that CAS is 
> loading the entry from the database:
>
> - snippet -
> 2019-11-13 16:24:22,706 DEBUG 
> [org.apereo.cas.services.AbstractServicesManager] -  [org.apereo.cas.services.ChainingServiceRegistry@3971e14f]>
> 2019-11-13 16:24:22,728 DEBUG 
> [org.apereo.cas.services.AbstractServicesManager] -  service [http(|s)://cas(|.*).messiah.edu(|.*)/cas-management(|/.*)]>
> 2019-11-13 16:24:22,729 INFO 
> [org.apereo.cas.services.AbstractServicesManager] -  from [MongoDbServiceRegistry].>
>
>
> Here is where it gets weird: when I load the management app, I see one 
> service entry that does NOT match the one loaded on startup.  I should also 
> note that I have the ticket registry replicated on the same MongoDB server 
> and it works perfectly.
>
> That's the short story, here are the details (these settings match on all 
> 3 servers "*cas-ha01, cas-ha02, cas-ha03*":
>
> -- cas.properties: --
> cas.server.name=https://cas-ha.messiah.edu
> cas.server.prefix=${cas.server.name}/cas
> cas.view.templatePrefixes[0]=file:///etc/cas/templates
> cas.logout.followServiceRedirects=true
> logging.config=file:/etc/cas/config/log4j2.xml
>
> mongo.db=casdb
> mongo.rs=rs0
> mongo.opts==true
> mongo.creds=mongocas:**
> mongo.hosts=cas-ha01.messiah.edu,cas-ha02.messiah.edu,cas-ha03.messiah.edu
> # The connection string, assembled
> mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db}?replicaSet=${
> mongo.rs}${mongo.opts}
>
> ### Remove default/local users (must be left blank) ###
> cas.authn.accept.users=
>
> ### Service Registry Setup ###
> #cas.serviceRegistry.json.location=file:/etc/cas/services
> #cas.serviceRegistry.initFromJson=true
> cas.serviceRegistry.mongo.databaseName=${mongo.db}
> cas.serviceRegistry.mongo.clientUri=${mongo.uri}
> cas.serviceRegistry.mongo.collection=casServiceRegistry
> cas.serviceRegistry.mongo.replicaSet=${mongo.rs}
> cas.serviceRegistry.mongo.sslEnabled=true
> cas.ticket.registry.mongo.clientUri=${mongo.uri}
>
>
> -- management.properties: --
> cas.server.name=https://cas-ha.messiah.edu
> cas.server.prefix=${cas.server.name}/cas
> mgmt.serverName=${cas.server.name}
> mgmt.userPropertiesFile=file:/etc/cas/config/adminusers.properties
>
> mongo.db=casdb
> mongo.rs=rs0
> mongo.opts==true
> mongo.creds=mongocas:**
> mongo.hosts=cas-ha01.messiah.edu,cas-ha02.messiah.edu,cas-ha03.messiah.edu
> # The connection string, assembled
> mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db}?replicaSet=${
> mongo.rs}${mongo.opts}
>
> ### Service Registry Setup ###
> #cas.serviceRegistry.json.location=file:/etc/cas/services
> cas.serviceRegistry.mongo.clientUri=${mongo.uri}
> cas.serviceRegistry.mongo.collection=casServiceRegistry
>
> -- pom.xml (cas server, dependencies): --
> ...
> 
> org.apereo.cas
> cas-server-webapp${app.server}
> ${cas.version}
> war
> runtime
> 
> 
> org.apereo.cas
> cas-server-support-ldap
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-ldap-core
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-webapp-config-security
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-core
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-api
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-webflow
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-rest
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-gauth
> ${cas.version}
> 
> 
>org.apereo.cas
>cas-server-support-jdbc-drivers
>${cas.version}
> 
> 
>  org.apereo.cas
>  cas-server-support-gauth-jpa
>  ${cas.version}
> 
> 
> 

[cas-user] Re: Service Registry in MongoDB (with replication)

2019-11-14 Thread Shawn Cutting
Update:

I found something else out in trying to get this working.  If I *manually* 
add a service to MongoDB, I am able to access that service via CAS (this 
was verified by deleting the record and subsequently getting the 
"Application not allowed" message, re-adding it and being allowed again).

So it seems that the issue is with the management application, not the CAS 
server.  I need to be able to manage the MongoDB records with the service 
application, and that is not possible for some reason.

Thanks in advance for any help.

Shawn


On Thursday, November 14, 2019 at 10:53:56 AM UTC-5, Shawn Cutting wrote:
>
> Good morning,
>
> I am at a total loss here about how to get CAS services to load from (and 
> to) MongoDB.  Following the instructions on David Curry's site 
>  
> (very well written, by the way), I have the mongodb server running and 
> replicating across 3 servers.  I am also able to successfully 
> auto-initialize the database with the JSON files.  I verify this by opening 
> mongodb and searching the collection "casServiceRegistry."
>
> *CAS version 5.3.14*, by the way.
>
> When I start the tomcat server and watch the debug logs, I see that CAS is 
> loading the entry from the database:
>
> - snippet -
> 2019-11-13 16:24:22,706 DEBUG 
> [org.apereo.cas.services.AbstractServicesManager] -  [org.apereo.cas.services.ChainingServiceRegistry@3971e14f]>
> 2019-11-13 16:24:22,728 DEBUG 
> [org.apereo.cas.services.AbstractServicesManager] -  service [http(|s)://cas(|.*).messiah.edu(|.*)/cas-management(|/.*)]>
> 2019-11-13 16:24:22,729 INFO 
> [org.apereo.cas.services.AbstractServicesManager] -  from [MongoDbServiceRegistry].>
>
>
> Here is where it gets weird: when I load the management app, I see one 
> service entry that does NOT match the one loaded on startup.  I should also 
> note that I have the ticket registry replicated on the same MongoDB server 
> and it works perfectly.
>
> That's the short story, here are the details (these settings match on all 
> 3 servers "*cas-ha01, cas-ha02, cas-ha03*":
>
> -- cas.properties: --
> cas.server.name=https://cas-ha.messiah.edu
> cas.server.prefix=${cas.server.name}/cas
> cas.view.templatePrefixes[0]=file:///etc/cas/templates
> cas.logout.followServiceRedirects=true
> logging.config=file:/etc/cas/config/log4j2.xml
>
> mongo.db=casdb
> mongo.rs=rs0
> mongo.opts==true
> mongo.creds=mongocas:**
> mongo.hosts=cas-ha01.messiah.edu,cas-ha02.messiah.edu,cas-ha03.messiah.edu
> # The connection string, assembled
> mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db}?replicaSet=${
> mongo.rs}${mongo.opts}
>
> ### Remove default/local users (must be left blank) ###
> cas.authn.accept.users=
>
> ### Service Registry Setup ###
> #cas.serviceRegistry.json.location=file:/etc/cas/services
> #cas.serviceRegistry.initFromJson=true
> cas.serviceRegistry.mongo.databaseName=${mongo.db}
> cas.serviceRegistry.mongo.clientUri=${mongo.uri}
> cas.serviceRegistry.mongo.collection=casServiceRegistry
> cas.serviceRegistry.mongo.replicaSet=${mongo.rs}
> cas.serviceRegistry.mongo.sslEnabled=true
> cas.ticket.registry.mongo.clientUri=${mongo.uri}
>
>
> -- management.properties: --
> cas.server.name=https://cas-ha.messiah.edu
> cas.server.prefix=${cas.server.name}/cas
> mgmt.serverName=${cas.server.name}
> mgmt.userPropertiesFile=file:/etc/cas/config/adminusers.properties
>
> mongo.db=casdb
> mongo.rs=rs0
> mongo.opts==true
> mongo.creds=mongocas:**
> mongo.hosts=cas-ha01.messiah.edu,cas-ha02.messiah.edu,cas-ha03.messiah.edu
> # The connection string, assembled
> mongo.uri=mongodb://${mongo.creds}@${mongo.hosts}/${mongo.db}?replicaSet=${
> mongo.rs}${mongo.opts}
>
> ### Service Registry Setup ###
> #cas.serviceRegistry.json.location=file:/etc/cas/services
> cas.serviceRegistry.mongo.clientUri=${mongo.uri}
> cas.serviceRegistry.mongo.collection=casServiceRegistry
>
> -- pom.xml (cas server, dependencies): --
> ...
> 
> org.apereo.cas
> cas-server-webapp${app.server}
> ${cas.version}
> war
> runtime
> 
> 
> org.apereo.cas
> cas-server-support-ldap
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-ldap-core
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-webapp-config-security
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-core
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-api
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-interrupt-webflow
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-rest
> ${cas.version}
> 
> 
> org.apereo.cas
> cas-server-support-gauth
> ${cas.version}
> 
> 
>org.apereo.cas
>cas-server-support-jdbc-drivers
>${cas.version}
> 
> 
>  org.apereo.cas
>  cas-server-support-gauth-jpa
>  ${cas.version}
> 
> 
> org.apereo.cas
>