简体   繁体   中英

google+ login - how to hide the clientid?

I am trying to get a simple google+ login working. I was able to get the javascript example working but that means I have to put my clientId on the same page which will be visible in source. I was doing some research and found so far that it may be possible to hide that code using a span/ div/ form-group? Not sure how to go about that. Including the details in css will still make the details accessible.

<div id="gConnect">
<button class="g-signin"
    data-scope="https://www.googleapis.com/auth/plus.login"
    data-requestvisibleactions="http://schemas.google.com/AddActivity"
    data-clientId="xxxx.apps.googleusercontent.com"
    data-callback="onSignInCallback"
    data-theme="dark"
    data-cookiepolicy="single_host_origin">
</button>

I plan to add facebook etc. to the project too so looking to find a generic way.

See related answer here . TLDR - you don't need to hide your client ID provided you have set up your server-side restrictions correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM