Skip to content

Commit 38e8a35

Browse files
committed
added web ini for CAS
1 parent e577fa8 commit 38e8a35

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
# INI configuration is very powerful and flexible, while still remaining succinct.
20+
# Please http://shiro.apache.org/configuration.html and
21+
# http://shiro.apache.org/web.html for more.
22+
23+
[main]
24+
25+
casOauthClient=org.pac4j.oauth.client.CasOAuthWrapperClient
26+
casOauthClient.casOAuthUrl=https://localhost:8443/openiot-cas/oauth2.0
27+
casOauthClient.key=openiot-requestdefinition-app
28+
casOauthClient.secret=openiot-requestdefinition-app-secret
29+
30+
# Sets the callbackUrl for each client in the list
31+
clients = org.pac4j.core.client.Clients
32+
clients.callbackUrl = http://localhost:8080/ui.requestDefinition/callback
33+
clients.clientsList = $casOauthClient
34+
35+
clientsFilter = org.openiot.security.client.CasOAuthClientFilter
36+
clientsFilter.clients = $clients
37+
clientsFilter.failureUrl = /error.xhtml
38+
39+
casOauthRoles = io.buji.pac4j.filter.ClientRolesAuthorizationFilter
40+
casOauthRoles.client = $casOauthClient
41+
42+
casOauthUsers = io.buji.pac4j.filter.ClientUserFilter
43+
casOauthUsers.client = $casOauthClient
44+
45+
clientsRealm = org.openiot.security.client.CasOAuthClientRealm
46+
clientsRealm.permissionsURL = https://localhost:8443/openiot-cas/oauth2.0/permissions
47+
clientsRealm.defaultRoles = ROLE_USER
48+
clientsRealm.clients = $clients
49+
50+
# Using a shiro native session manager instead of the Servlet container's sessions
51+
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
52+
# 1,800,000 milliseconds = 30 seconds
53+
sessionManager.globalSessionTimeout=1800000
54+
securityManager.sessionManager = $sessionManager
55+
56+
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
57+
cacheManager.cacheManagerConfigFile=classpath:ehcache-sec-client.xml
58+
securityManager.cacheManager = $cacheManager
59+
60+
authc.loginUrl = /login.xhtml
61+
62+
#[users]
63+
# format: username = password, role1, role2, ..., roleN
64+
65+
66+
[roles]
67+
# format: roleName = permission1, permission2, ..., permissionN
68+
69+
[urls]
70+
# The /login.jsp is not restricted to authenticated users (otherwise no one could log in!), but
71+
# the 'authc' filter must still be specified for it so it can process that url's
72+
# login submissions. It is 'smart' enough to allow those requests through as specified by the
73+
# shiro.loginUrl above.
74+
75+
# NOTE: Order matters! The first match wins.
76+
77+
/logout = logout
78+
/callback = clientsFilter
79+
/signup.xhtml = anon
80+
/index.* = authc
81+
/index = authc
82+
/home.* = authc
83+
/error.xhtml = anon
84+
#/roles.* = anon
85+
#/users.* = anon
86+
#/perms.* = anon
87+
/home = authc
88+
/javax.faces.*/** = anon
89+
/login.xhtml = anon
90+
/** = casOauthRoles[ROLE_USER]
91+
/?*/** = casOauthRoles[ROLE_USER]
92+
#/account/** = authc
93+
#/remoting/** = authc, roles[b2bClient], perms["remote:invoke:lan,wan"]

0 commit comments

Comments
 (0)