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

[JAVA SDK] Auth failed with error: {"error":"invalid_client","error_description":"unknown client id"} #501

Closed
sunpeng981712364 opened this issue May 5, 2024 · 2 comments

Comments

@sunpeng981712364
Copy link

sunpeng981712364 commented May 5, 2024

Issue you'd like to raise.

JAVA SDK 版本号

    <dependency>
        <groupId>com.baidubce</groupId>
        <artifactId>qianfan</artifactId>
        <version>0.0.4</version>
    </dependency>

    ChatBuilder chatBuilder = new Qianfan(Auth.TYPE_OAUTH, "", "").chatCompletion().model(modelName);
    for (MMessage message : this.messages) {
        chatBuilder = chatBuilder.addMessage(message.getRole(), message.getContent());
    }
    ChatResponse response = chatBuilder.temperature(0.7).execute(); // 发起请求
    System.out.println(response.getResult());

: Cookie rejected [BAIDUID="23AAEAA93B85ECFF24E013F37:FG=1", domain:baidu.com, path:/, expiry:Mon May 05 17:57:27 CST 2092] Illegal 'domain' attribute "baidu.com". Domain of origin: "aip.baidubce.com"
INFO 38732 --- [nio-8020-exec-3] : Auth failed with error: {"error":"invalid_client","error_description":"unknown client id"}

Suggestion:

No response

@sunpeng981712364
Copy link
Author

sunpeng981712364 commented May 5, 2024

求助 @Azure99

@sunpeng981712364 sunpeng981712364 changed the title Auth failed with error: {"error":"invalid_client","error_description":"unknown client id"} [JAVA SDK] Auth failed with error: {"error":"invalid_client","error_description":"unknown client id"} May 5, 2024
@Azure99
Copy link
Collaborator

Azure99 commented May 6, 2024

请检查传入的QIANFAN_AKQIANFAN_SK是否正确。
注意,如果使用Auth.TYPE_OAUTH来鉴权,传入的API Key和Secret Key需要在应用接入获取。
参考链接:https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Slkkydake

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

No branches or pull requests

3 participants