Authentication with Yammer Javascript SDK & Things That Can Go Wrong

Anyone that’s in a relationship knows that what the other person says and what they mean can be vastly different.  And so it is with Yammer authentication.

The Basics

1.  Add the yammer sdk and enter the client_id of your application. (Note: the library changed recently to c64…)

<script type="text/javascript" data-app-id="********"

2.  Add the login button in the body.

<span id="yammer-login"></span>

3.  Add the login function

function login() {
        yam.connect.loginButton('#yammer-login', function (resp) {
            if (resp.authResponse) {
                document.getElementById('yammer-login').innerHTML = '[You are logged in!]';                

login login copy

He Said, She Said

1.  “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource…”

Add the host ip that your app is running on in the Javascript Origin section under “Basic Info” of your app.

Many times, this can happen because you’re calling -vs-

2.  “JScript5:  Access Denied” (in IE)

Add https://* and the host of your app to the Trusted Sites.

3.  You can just call  yam.getLoginStatus… without the login button but in Safari this seems to fail.

  • Someone once told me, "You win some and you lose some."

    The opinions stated here are my own and not of my employer's.

  • Archives

  • Advertisements