Hello everyone,
My video demonstrating how to provide best secured way to log onto Windows Azure Websites using a QR Code is now online on Channel9, in the Web Camps Show.
Happy viewing
Microsoft is now adding Git support for Visual Studio and TFS, so that you can open, clone and commit projects directly with you preferred Git provider.
More details on the Channel9 video here;
Happy coding
I was working these days on deploying a few sites built on MVC4 Web API, using Entity Framework along with Spatial types (Geometry and Geopraphy types).
Everything was fine on my dev box, unless I started to deploy the solution on Azure.
Most of my WebAPIs calls were giving me a {“Message”:”An error has occurred.”}
That comes from a miss in the binaries coming along with your site once deploying it; just open your Nuget Package Manager interface, search for the “Microsoft.SqlServer.Types” package and add it to your site project.
Tada
In quite some projects, I had to localize some SharePoint 2010 pages or WebPart resources, which custom code can handle pretty well.
But when it comes to localize titles of WebPart, SharePoint does actually not provide anything but a single string for any language.
I then built an abstract class named LocalizableWebPart, which with a few helper classes helps you set the WebPart title by editing it and changing the current site display language.
Here is the content of this class so that you can have a look:
public abstract class LocalizableTitleWebPart : WebPart
{
[WebPartStorage(Storage = Storage.Shared)]
public string LocalizedTitle { get; set; }
private LangageContainer langContainer = null;
protected string GetLocalizedProperty(LangageContainer container, string content)
{
if (container != null)
{
return container.GetOrInsertLanguage().EncodedLanguageContent;
}
else
{
container = LocalizationHelper.GetLanguagesContent(content);
return container.GetOrInsertLanguage().EncodedLanguageContent;
}
}
protected string SetLocalizedProperty(LangageContainer container, string content, string value)
{
container = LocalizationHelper.GetLanguagesContent(content);
var lang = container.GetOrInsertLanguage();
if (this.Page != null && this.Page.IsPostBack)
{
container.UpdateLanguage(lang.LanguageCode, value);
return LangageContainer.Serialize(container);
}
return content;
}
public override string Title
{
get
{
return GetLocalizedProperty(langContainer, this.LocalizedTitle);
}
set
{
this.LocalizedTitle = SetLocalizedProperty(langContainer, this.LocalizedTitle, value);
}
}
}
What you can see in the code above is:
You can find the code of this class and all required classes as a GitHub repo here:
https://github.com/JaYmZ666/localizableTitleWebPart
Happy coding!
Hi dear visitor,
This year Microsoft Techdays will be held at Conrès Beaulieu in Lausanne, on the 6th and 7th of November.
Yves Peneveyre and myself will be presenting a topic around SharePoint 2013 (in French
)
As I will be available between sessions on the CTP booth, please feel free to come and visit us, and ask questions about our work and Windows Azure for example
See you there!
In this article series, I am going to address how to create you own custom Security Token Service (STS) to authenticate your users using claims, and using it through ACS to offer more Identity Providers to your Azure app.
This article series is composed of:
In this article series, I am going to address how to create you own custom Security Token Service (STS) to authenticate your users using claims, and using it through ACS to offer more Identity Providers to your Azure app.
This article series is composed of:

Now that the FederationMetadata.xml file is set, we need to link our STS with ACS, so that ACS can transfert users to the new STS and also decrypt tokens coming from it.
The idea here is to set your STS Identity Provider behind ACS, so that your web apps have only to trust ACS as an IdP, which will then take care of transforming your STS IdP tokens (along with OOB IdPs such as Live ID or Google account) and send it to your app.
I have been looking around the web for reading a QR Code from the camera of their Windows 8 device.
No luck I found nothing that was looking in that direction.
So I just take the ZXing barcode scanning library from Codeplex, modified it a bit, but the biggest part was around getting the output of the webcam as stream to get frames from it and send it over to this barcode library.
First problem, Windows 8 doesn’t support getting frames out of Video stream from managed code.
I am not really in the mood of writing C++ right now, so I just used the MediaCapture.CapturePhotoToStreamAsync method to get periodically the image from the webcam and send it over to the QRCodeReader.
Second problem, the stream received by the CapturePhotoToStreamAsync method is a BMP format in my case, and Windows 8 doesn’t expose a lot of ways to manipulate bits within the image, especially in the case I need luminance from the BMP ARGB format.
I ended up skipping the first 54 bytes of the stream (BMP header bytes) and then reading against all values to create a luminance byte array to give to the QRDecoder (that only work with luminance actually).
The last trick I tried to sue was to display a preview video stream on the screen while getting images from the photo stream, but even though Windows 8 doesn’t crash when creating, initializing and reading from multiple MediaCapture objects, it actually doesn’t display anything on the video stream part.
At the end the solution I am sharing here is displaying the same image used for scanning he barcode, which explain quite some latency between displays.
Feel free to use it and to share it for optimizing it a little bit
UPDATE: I just completely rewrote the code in a more WinRT (async await) way, which gives the app far more responsive for scanning QR Codes!!
Code sample here.
In this article series, I am going to address how to create you own custom Security Token Service (STS) to authenticate your users using claims, and using it through ACS to offer more Identity Providers to your Azure app.
This article series is composed of:
Now that the STS is built and the cretificates have been added to it, let’s now build the FederationMetadata.xml file.
But, what exactly is this FederationMetadata.xml file for?
This file serves multiple purposes:
Of course, what we see previously (especially the encryption part) is not part of the FederationMetadata.xml.
In our consideration of using ACS to offer our STS plus existing ones within ACS, the decrypting part configuration will be done in ACS directly when routing tokens.
So the real question is now: how do I build my FederationMetadata.xml to make it readable and usable by our ACS??
2 options:
For the first solution have a look here.
For the second one please make sure to download Custom STS Metadata File Editor, which I copied on my blog as it was really hard to get
Going through this configuration tool, make sure not to modify the file manually once you created it, especially if you leave the Sign with Certificate default check when you selected your Certificate on the “Certificate” tab:
Looking at all variables that need to be put in place within the STS, please get inspiration from my FederationMetdata.xml file here, that contains all settings to get your STS ready:
Have a look at a part on this file here for the URLs that link back to your Azure STS deployment:
<fed:SecurityTokenServiceEndpoint>
<EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
<Address>https://mystsdemo.cloudapp.net/PassiveSTS.aspx</Address>
<Metadata>
<Metadata xmlns="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
<wsx:MetadataSection Dialect="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns="">
<wsx:MetadataReference>
<Address xmlns="http://www.w3.org/2005/08/addressing">https://mystsdemo.cloudapp.net/PassiveSTS.aspx/mex</Address>
</wsx:MetadataReference>
</wsx:MetadataSection>
</Metadata>
</Metadata>
</EndpointReference>
</fed:SecurityTokenServiceEndpoint>
<fed:PassiveRequestorEndpoint>
<EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
<Address>https://mystsdemo.cloudapp.net/PassiveSTS.aspx</Address>
</EndpointReference>
</fed:PassiveRequestorEndpoint>
I am here especially pointing to the section that contains the URLs for your STS, that will help ACS to know where to forward the authentication request and get back the result (signing and encryption part).
There we go, next, configuring ACS our STS!
In this article series, I am going to address how to create you own custom Security Token Service (STS) to authenticate your users using claims, and using it through ACS to offer more Identity Providers to your Azure app.
This article series is composed of:
Let’s see how we can create and use our certificates in our own Windows Azure STS; this includes:
