如何在 Laravel 中使用 API 密钥对 google_client 进行身份验证?

像 js 一样,我只需要 apikey 进行身份验证,并且可以调用其他 api,例如 google_service_youtube

function loadClient() {
    gapi.client.setapiKey("xxxxxxxxRc6V7p6WlZsar0elij3wJxxbn8owBNr8");
    return gapi.client.load("https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest")
        .then(function() { console.log("GAPI client loaded for API"); },function(err) { console.error("Error loading GAPI client for API",err); });
}

gapi.load("client:auth2",function() {
    gapi.auth2.init({ client_id: "xxxxxxxxx-ib4ithohjejiv213ju49m1tts0bgqtfh.apps.googleusercontent.com" });
    loadClient()
});

调用 api youtube

function handleGetView() {
            return gapi.client.youtube.videos.list({ "part": ["statistics"],"id": ['EYGI-rdg9ts']
            }).then(function(response) {
                console.log("Response",response);
            },function(err) { console.error("Execute error",err); });
        }

laravel 上有没有类似的代码?

smalltiger67 回答:如何在 Laravel 中使用 API 密钥对 google_client 进行身份验证?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1105233.html

大家都在问