{"record":{"id":"15f2a60e39e3d3c9","repo":"justauth/JustAuth","slug":"5002","errorCode":"5002","errorMessage":"Parameter incomplete","messagePattern":"Parameter incomplete","errorType":"exception","errorClass":"AuthException","httpStatus":null,"severity":"error","filePath":"src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java","lineNumber":132,"sourceCode":"     * @see AuthAlipayRequest#AuthAlipayRequest(me.zhyd.oauth.config.AuthConfig, me.zhyd.oauth.cache.AuthStateCache, java.lang.String, java.lang.Integer)\n     */\n    public AuthAlipayRequest(AuthConfig config, String alipayPublicKey, AuthStateCache authStateCache, String proxyHost, Integer proxyPort) {\n        super(config, AuthDefaultSource.ALIPAY, authStateCache);\n        this.alipayPublicKey = determineAlipayPublicKey(alipayPublicKey, config);\n        check(config);\n        this.alipayClient = new DefaultAlipayClient(GATEWAY, config.getClientId(), config.getClientSecret(),\n            \"json\", \"UTF-8\", this.alipayPublicKey, \"RSA2\", proxyHost, proxyPort);\n    }\n\n    private String determineAlipayPublicKey(String alipayPublicKey, AuthConfig config) {\n        return alipayPublicKey != null ? alipayPublicKey : config.getAlipayPublicKey();\n    }\n\n    protected void check(AuthConfig config) {\n        AuthChecker.checkConfig(config, AuthDefaultSource.ALIPAY);\n\n        if (!StringUtils.isNotEmpty(alipayPublicKey)) {\n            throw new AuthException(AuthResponseStatus.PARAMETER_INCOMPLETE, AuthDefaultSource.ALIPAY);\n        }\n\n        // 支付宝在创建回调地址时，不允许使用localhost或者127.0.0.1\n        if (GlobalAuthUtils.isLocalHost(config.getRedirectUri())) {\n            // The redirect uri of alipay is forbidden to use localhost or 127.0.0.1\n            throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, AuthDefaultSource.ALIPAY);\n        }\n    }\n\n    @Override\n    protected void checkCode(AuthCallback authCallback) {\n        if (StringUtils.isEmpty(authCallback.getAuth_code())) {\n            throw new AuthException(AuthResponseStatus.ILLEGAL_CODE, source);\n        }\n    }\n\n    @Override\n    public AuthToken getAccessToken(AuthCallback authCallback) {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/justauth/JustAuth/blob/694bbf1b010d93404e3bfb4824d90e9ddfaebebb/src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java#L114-L150","documentation":"AuthException with AuthResponseStatus.PARAMETER_INCOMPLETE (code 5002) thrown from AuthAlipayRequest.check when neither the constructor's alipayPublicKey argument nor config.getAlipayPublicKey() is non-empty. Alipay requires the platform's public key to verify gateway responses, so the request cannot be built.","triggerScenarios":"Building AuthAlipayRequest (or the via AuthRequestBuilder) with an AuthConfig that omits alipayPublicKey. AuthChecker.checkConfig already passed because clientId/clientSecret/redirectUri are present, but the Alipay-specific key check fails.","commonSituations":"Copying an AuthConfig from another provider's example and forgetting alipayPublicKey; storing the key in an env var that is not set in the deploy environment; accidentally passing the app's own private key under a different name and leaving alipayPublicKey blank.","solutions":["Set alipayPublicKey on the AuthConfig (the Alipay open-platform public key, not your app's private key) before constructing the request","If using certificate mode, build AuthAlipayCertRequest instead with app-cert, alipay-public-key-cert and root-cert paths","Verify the key survives environment promotion (dev/staging/prod) — log AuthConfig key presence at startup"],"exampleFix":"// before\nAuthConfig config = AuthConfig.builder()\n    .clientId(id).clientSecret(secret).redirectUri(uri).build();\nnew AuthAlipayRequest(config);\n\n// after\nAuthConfig config = AuthConfig.builder()\n    .clientId(id).clientSecret(secret).redirectUri(uri)\n    .alipayPublicKey(\"MIIBIjANBgkq...\").build();\nnew AuthAlipayRequest(config);","handlingStrategy":"validation","validationCode":"if (StringUtils.isEmpty(config.getAlipayPublicKey())) {\n    throw new IllegalStateException(\"ALIPAY requires alipayPublicKey in AuthConfig\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate provider-specific config fields at application startup, not at first login","Keep a config smoke test per environment asserting required keys exist","Use the Alipay open-platform public key, never your app private key"],"tags":["alipay","config","validation"],"backgroundTag":null,"analyzedSha":"694bbf1b010d93404e3bfb4824d90e9ddfaebebb","analyzedAt":"2026-08-14T15:16:59.945Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}