使用OAuth2.0访问Google日历错误:重定向\u uri\u不匹配

使用OAuth2.0访问Google日历错误:重定向\u uri\u不匹配,oauth,google-api,google-calendar-api,google-api-java-client,Oauth,Google Api,Google Calendar Api,Google Api Java Client,我正在试着运行这个程序。但是在运行http://localhost:8888,它会产生以下错误 Error: redirect_uri_mismatch The redirect URI in the request: http://localhost:8888/oauth2callback did not match a registered redirect URI Learn more Request Details cookie_policy_enforce=false scope

我正在试着运行这个程序。但是在运行
http://localhost:8888
,它会产生以下错误

Error: redirect_uri_mismatch

The redirect URI in the request: http://localhost:8888/oauth2callback did not match a registered redirect URI

Learn more

Request Details
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/calendar
response_type=code
access_type=offline
redirect_uri=http://localhost:8888/oauth2callback
display=page
client_id=400798961688.apps.googleusercontent.com
我的google控制台注册了以下url

Redirect URIs:  
http://localhost:8888/oauth2callback
https://localhost:8888/oauth2callback

JavaScript origins: http://localhost:8888
https://localhost:8888
有人能帮我吗