Showing posts with label Yammer. Show all posts
Showing posts with label Yammer. Show all posts

Thursday, September 12, 2019

Use Office 365 connected groups in Yammer

Yammer platform allows you to integrate your Yammer groups to Office 365. Technically it means that each time when new Yammer group will be created it will be also created in Azure AD of the tenant of this Yammer network. More information about Yammer and O365 groups can be found in this article: Yammer and Office 365 Groups. This article also contains information how to enable Office 365 connected groups in Yammer and which conditions should be met before you will be able to enable it:

  • You must enforce Office 365 identity for Yammer users. When you first enforce Office 365 identity there is a seven-day trial period, after which the Status of your Office 365 Identity Enforcement changes to Committed.
  • Your Yammer network must be in a 1:1 network configuration. This means you have one Yammer network that is associated with one Office 365 tenant.

Note that currently it is possible to enforce Office 365 identity for Yammer users without 7 days trial i.e. right away.

In order to enable Office 365 connected groups in Yammer it you need to login to your Yammer network with administrator account and go to Network settings (gear icon in top left) > Network Admin > Security setting. On this page at first we need to enforce Office 365 identity for Yammer users:

Once it’s status will be changed to Committed after some time “Office 365 Connected Yammer Groups” setting will be changed to Enabled:

Documentation above says that it takes up to 24h to change status to Enabled. But in my case it was changed quite fast: almost immediately after enforcing of Office 365 identity for Yammer users.

Let’s see what happens when “Office 365 Connected Yammer Groups” setting is disabled for your Yammer network. When you create new Yammer group:

this group won’t be found in Azure AD of the Yammer network’s tenant:

After Office 365 Connected Yammer Groups have been enabled Yammer groups will appear in Yammer:

So you will be able to use all advantages of O365 connected groups. Note that for those Yammer groups which already exist when O365 connected groups had been enabled also appropriate O365 groups will be created after some time. Documentation says that it may take up to 1 week:

After about 1 week, existing eligible groups will be converted to Office 365 groups.

but for me it also happened quite fast within 1 hour or so.

Friday, February 3, 2017

Improve Yammer embed feed performance on Sharepoint Online

Yammer embed feed is often added to the front page of the company intranet in Sharepoint. From one side it adds value to customers as users may see corporate feed together with other important content on the same page. From other side it adds drawback: increase of the total page load time (by total time I mean time needed for both server and client side components. Yammer adds more time to the client part). We measured that Yammers adds ~3-4 seconds to the scripting part of the page load time. Is there a way to improve situation?

Let’s check how Yammer embed feed is added on the page. In most cases it is added via Content editor web part and the following code:

   1: <!DOCTYPE HTML>                                          
   2: <html>
   3:     <head></head>
   4:     <body>
   5:         <script type="text/javascript"
   6: src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
   1:                                                   
   2:         <div id="embedded-feed" style="height:1000px;width:400px;"></div>
   3:         <script>
   4:             yam.connect.embedFeed({"config": { "header": false },
   5:                 "container": "#embedded-feed",
   6:                 network: 'example.com' });
   7:             $(window).load(function () {
   8:                 $('.frontpage #embedded-feed').width('100%');
   9:             });
  10:         
</script>
   7:     </body>
   8: </html>

As you can see script is loaded from Yammer CDN https://c64.assets-yammer.com/assets/platform_embed.js. So the first thing I tried was to move this script to the Sharepoint doclib, but it didn’t give visible results (internally this script loads a lot of other scripts and css files from CDN and also adds iframe dynamically).

After that I tried to use another approach which gave some results. First of all create new page (e.g. yammer.aspx) in Pages doclib and detach it from Page layout via Sharepoint Designer. After that remove all code from there and add only Yammer code shown above.

Then we need to modify the page where we show embed Yammer feed: instead of Content editor web part which was used for Yammer initially we will use Page viewer web part and configure it to use newly created page yammer.aspx as a source (that’s why we needed to detach this page from page layout – it should not contain any UI elements like headers, navigation, etc. It should only contain Yammer widget). I.e. after that page will look the same, but technically there is difference how Yammer is shown there. Now Yammer is shown in sub page via iframe in separate http request and its scripts not affect load of basic page. At least for us after that our testing showed that scripting time was reduced on ~2 seconds. Hope that information will be helpful for you.

Wednesday, July 22, 2015

Problem with X-Frame-Options: SAMEORIGIN in Yammer embedded feed

When you add Yammer embed feed to your Sharepoint Online site you may have the following problem: if user didn’t complete Yammer signup then instead of the feed he or she will see empty box inside iframe. To be more precise you may face with this problem if your site is running on any other platform or technology, but as I faced with it on Sharepoint Online, I decided to mentioned it here.

Let’s see it in more details. Embedded feed is loaded using the following code:

   1: <script src="https://c64.assets-yammer.com/assets/platform_embed.js"
   2: type="text/javascript"></script>
   1:  
   2: <div id="embedded-feed" style="height:800px;"></div>
   3: <script type="text/javascript">
   4:     yam.connect.embedFeed({ container: '#embedded-feed', network: 'example.com'});
</script>

When user has active Yammer profile it shows the Yammer feed in iframe which is added into div with specified identifier. However when user doesn’t have profile yet, empty page will be shown. The reason of this problem is the following: when user didn’t complete Yammer signup and iframe loads feed page which URL looks like this:

https://www.yammer.com/platform_embed/feed?container=%23embedded-feed&network=example.com&network_permalink=example.com&bust=…

(instead of example.com you will have your domain here and bust will have identifier which corresponds to the current user), it redirects user to the following page:

https://www.yammer.com/example.com/signup/complete_signup?activation_code=…&user_id=…

One of the HTTP headers returned in response for this page is the following:

X-Frame-Options: SAMEORIGIN

This header tells to the browser that remote site can’t be loaded in iframe if parent page belongs to different domain (different from yammer.com).

In order to tell user about that he or she should complete signup first the following script may be used:

   1:  
   2: var g_YammerCompleteSignup_CompletePolling = false;
   3: function YammerCompleteSignup(){
   4:     if (jQuery("iframe#embed-feed").length) {
   5:         try {
   6:             var url = jQuery("iframe#embed-feed").attr("src");
   7: jQuery("#embedded-feed").prepend("<span style='background: url(/_layouts/images/info16by16.gif) " +
   8:     "no-repeat; display: inline-block; background-size: 16px 16px; height: 16px; " +
   9:     "padding-left: 18px;'><span style='font-size: 12px; height: 16px; display: table-cell; " +
  10:     "vertical-align: middle;'>Yammer feed will be empty if you don't have Yammer account yet. " +
  11:     "Click <a href='" + url + "' target='_blank'>here</a> in order to complete signup and then " +
  12:     "refresh this page.</span></span>");
  13:         } finally {
  14:             g_YammerCompleteSignup_CompletePolling= true;
  15:         }
  16:     }
  17:     
  18:     if (g_YammerCompleteSignup_CompletePolling) {
  19:         return;
  20:     }
  21:  
  22:     setTimeout(YammerCompleteSignup, 2000);
  23: }

It starts polling the DOM and when iframe is added by yam.connect.embedFeed() call, it reads its src and uses it when add informational notice above the iframe, which looks like this:

image

The drawback of this approach is that this text will be shown both for users which already completed signup and for users which didn’t do that.