0

I need to authenticate a user using Yammer before posting comments from my ionic 2 app. i am using yammer js sdk for this. its working in browser fine. its opening login popup and closing. when i try running the same in mobile its opening the inappbrowser and showing about:blank at the bottom. not redirecting from there.

i am calling the sdk this way:

yam.platform.login((loginResp)=>{

  console.log("loginResp:"+JSON.stringify(loginResp));
});

i have included the js sdk this way:

<script data-app-id="appid" src="external/yammer_js_sdk.js"></script>

because of the above login call its opening the inappbrowser but stuck there. can somebody help me?

praveen seela
  • 538
  • 11
  • 24

1 Answers1

0

If you notice in Browser, login opens as a pop up window. Which is not possible in Ionic/Cordova app. Check the logs by connecting the simulator/device and you would notice

"{adfs redirection URL} in a frame because it set 'X-Frame-Options' to 'DENY'."

Check another post from StackOverFlow which talks about the error @ How to set 'X-Frame-Options' on iframe?

Try using User Impersonation i.e, Pre-Auth @ Microsoft Blog
Which talks about 1. Generating Verified Admin Developer Token for Yammer 2. Fetch UserID using Email ID. 3. Fetch User Access Token using Impersonation. 4. Set AuthToken using yam.platform.setAuthToken({token}) - This avoid per user login.

Weigh your requirements and you may use this approach.

Community
  • 1
  • 1
Dileep Mettu
  • 140
  • 12