Skip to content

Calling the API keeps prompting unauthorized. I have followed the documentation, but it still doesn't work #3004

@MengProject-923

Description

@MengProject-923

Question and Steps to reproduce

1.本地配置,如下
##进入docker,查看配置
root@nightingale:/app/etc# pwd
/app/etc
root@nightingale:/app/etc# cat config.toml
注:摘取重要部分
[HTTP.TokenAuth]
Enable = true
HeaderUserTokenKey = "X-User-Token"

[HTTP.ProxyAuth]

if proxy auth enabled, jwt auth is disabled

Enable = false

username key in http proxy header

HeaderUserNameKey = "X-User-Name"
DefaultRoles = ["Standard"]

[HTTP.RSA]

open RSA

OpenRSA = false

[DB]

postgres: DSN="host=127.0.0.1 port=5432 user=root dbname=n9e_v6 password=1234 sslmode=disable"

DSN="root:1234@tcp(mysql:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true"

enable debug mode or not

2.系统创建token

Image

3.pycharm调试

Image

Relevant logs and configurations

见上述

Version

8.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions