Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version nacosv2.3.1 and env NACOS_AUTH_CACHE_ENABLE: 'true' can not enable #12714

Open
only21tender opened this issue Oct 10, 2024 · 1 comment

Comments

@only21tender
Copy link

only21tender commented Oct 10, 2024

I use nacos version v 2.3.1 , and default
NACOS_AUTH_SYSTEM_TYPE :nacos
NACOS_AUTH_ENABLE :false
while I login nacos, it will be login auth and without no insert user and pass.

deploy it in k8s
when I set core auth in configmap

data:
MYSQL_SERVICE_DB_NAME: user
MYSQL_SERVICE_DB_PARAM: >-characterEncoding=utf8&connectTimeout=10000&socketTimeout=30000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
MYSQL_SERVICE_HOST: mysql-url
MYSQL_SERVICE_PASSWORD: pass
MYSQL_SERVICE_PORT: '3306'
MYSQL_SERVICE_USER: databases
NACOS_AUTH_CACHE_ENABLE: 'true' -- notation here
SPRING_DATASOURCE_PLATFORM: mysql

and restart statefulset nacos ,then cat config in pod
[root@nacos231-0 nacos]# cat conf/application.properties |grep -i auth
###The auth system to use, currently only 'nacos' and 'ldap' is supported:
nacos.core.auth.system.type=${NACOS_AUTH_SYSTEM_TYPE:nacos}
###worked when nacos.core.auth.system.type=nacos
nacos.core.auth.plugin.nacos.token.expire.seconds=${NACOS_AUTH_TOKEN_EXPIRE_SECONDS:18000}
nacos.core.auth.plugin.nacos.token.secret.key=${NACOS_AUTH_TOKEN:}
###Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
nacos.core.auth.caching.enabled=${NACOS_AUTH_CACHE_ENABLE:false} -- notation here
nacos.core.auth.enable.userAgentAuthWhite=${NACOS_AUTH_USER_AGENT_AUTH_WHITE_ENABLE:false}
nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:}
nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_VALUE:}
nacos.security.ignore.urls=${NACOS_SECURITY_IGNORE_URLS:/,/error,/

the environment of NACOS_AUTH_CACHE_ENABLE which I set in configmap , it does't effect.

please help me

@KomachiSion
Copy link
Collaborator

It will be replaced directly, it depend spring boot read the configuration from env and properties file.

Why do you think this config is not enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants