#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

# =======================
# Shiro INI configuration
# =======================

[main]
# Security Manager Configuration
cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager
propertyRealm = propertyRealm
propertyRealm.iniRealm = $iniRealm
securityManager.realms = $propertyRealm

# SSL filter enabled only in production mode
; disable checking for particular ports when SSL is enabled
ssl.enablePortFilter = false

# Remember Me - set cookie expiry for 2 weeks
securityManager.rememberMeManager.cookie.maxAge = 1209600

# JSF Ajax support
fallbackType = useFallback
authc.loginFallbackType = $fallbackType
authc.logoutFallbackType = $fallbackType

# Auth configuration
authc.loginUrl = /shiro/auth/loginform
authc.useRemembered = true
; wait for two seconds if login fails
; authc.loginFailedWaitTime = 2
roles.unauthorizedUrl = /shiro/auth/unauthorized
perms.unauthorizedUrl = /shiro/auth/unauthorized

# Site-specific security configuration
[urls]
# Admin pages
/shiro/adminpage* = ssl, authc, roles[admin]

# User pages
/shiro/index* = ssl, anon
/shiro/unprotected/** = ssl, anon
/shiro/* = ssl, authc, perms[pages:read]

# Login pages
/shiro/auth/unauthorized* = ssl, authc
/shiro/auth/login* = ssl, authc
/shiro/auth/logout* = ssl, logout
/shiro/auth/** = ssl, anon

# All other pages - fallback
/** = anon

# User config
[users]
admin = adminpwd, admin
webuser = webpwd, regular

[roles]
admin = *
regular = pages:read
