blog.vi-kan.net One thought after another

Azure Mobile Services & Active Directory authentication

TLDR; When authenticating against Azure Active Directory through the Azure Mobile Services, use the magic string aad as he provider, not windowsazureactivedirectory as stated in the documentation.

I just tried out Azure Mobile Services. If you need a simple backend for your app, mobile services may be the way to go. It supports all mayor mobile plattforms (iOS, Android and WinPhone) as well as html5/js and windows store applications.

One of the things it gives you, is easy authentication through 3rd party providers like facebook and twitter. It also supports azure active directory, which is nice for internal applications.

There is one problem, though. The documentation seems to be a little off...

There are documentation for all platforms. Lets have a look at the iOS one:


  1. Open the project file QSTodoListViewController.m and in the viewDidLoad method, remove the following code that reloads the data into the table:
        [self refresh];
  1. Just after the viewDidLoad method, add the following code:
        - (void)viewDidAppear:(BOOL)animated
        {
            MSClient *client = self.todoService.client;            
            if (client.currentUser != nil) {
                return;
            }            
            [client loginWithProvider:@"facebook" controller:self animated:YES completion:^(MSUser *user, NSError *error) {
                [self refresh];
            }];
        }

Note If you are using an identity provider other than Facebook, change the value passed to loginWithProvider above to one of the following: microsoftaccount, facebook, twitter, google, or windowsazureactivedirectory.

  1. Press the Run button to build the project, start the app in the iPhone emulator, then log-on with your chosen identity provider.

    When you are successfully logged-in, the app should run without errors, and you should be able to query Mobile Services and make updates to data.


The code shows how to authenticate through facebook, and the note states that you can use active directory instead by changing @"facebook" to @"windowsazureactivedirectory".

When I tried this, I got a 401 error with the message

"Error: Authentication with 'windowsazureactivedirectory' is not supported."

For some reason I decided to try with @"aad" instead, and lo and behold - it worked!

Since the documentation is hosted on GitHub, I dropped a pull request to notify them of the issue.

Update: the pull request was excepted, and the documentation will soon be (more) accurate on this topic.

Dagens fotnoter… #8

Micro-ORM

Mye prat om micro-orms for tiden. Denne podcasten gir ett lite innblikk i hva det dreier seg om. http://www.hanselminutes.com/default.aspx?showID=282

DevDays 2011, Netherlands

Opptak fra DevDays 2011 er lagt ut på channel 9. http://channel9.msdn.com/Events/DevDays/DevDays-2011-Netherlands

Bart De Smet hadde en interessant session om 10 c# language features. http://channel9.msdn.com/Events/DevDays/DevDays-2011-Netherlands/Devdays041

Breakpoints on Xaml in Silverlight 5

Montro om dette også blir mulig i WPF? Ville vært høyst velkomment. http://jesseliberty.com/2011/04/26/breakpoints-on-xaml-in-silverlight–5/

MineCraft

Dette fenomenet må en visst bare vende seg til. http://www.minecraft.net/

Dagens fotnoter… #7

ControlTemplate & Triggers

{RelativeSource TemplatedParent} is not working in DataTriggers of a ControlTemplate http://www.wpftutorial.net/Templates.html

MIX11

Opptak av foredrag er tilgjengelig på channel9 sine sider. http://channel9.msdn.com/events/MIX/MIX11/

SoundSwitch

Et lite, men genialt, verktøy for kjapt å flytte lyden mellom ulike outputs. http://blog.contriving.net/2009/05/04/a-hotkey-to-switch-between-headphones-and-speakers-soundswitch/

Dagens fotnoter… #6

Torbjørn Marø

Blogger på norsk om .net, ruby, clojure . Har sin egen tegneserie, ‘the contiki strip’ Jobber som senior utvikler/teamleder i PCWinCom og aktiv i NNUG Bergen http://kjempekjekt.com

Decipering Burndown Charts

Sprint Burndown says a lot about your scrum team…, Hiren Doshi http://www.practiceagile.com/2010/02/sprint-burndown-says-lot-about-your.html

Seven common Sprint Burndown Chart Signatures, Kane Mar http://kanemar.com/2006/11/07/seven-common-sprint-burndown-graph-signatures/

Feel the burn: Getting the most out of burn charts, George Dinwiddie http://idiacomputing.com/pub/BetterSoftware-BurnCharts.pdf

Dagens fotnoter… #5

Caliburn.micro

MVVM-framework with heavy use of conventions http://caliburnmicro.codeplex.com/

Rob Eisenberg on .net Rocks! http://dotnetrocks.com/default.aspx?showNum=638

Scrummaster-fragrance

You’re certified as a ScrumMaster. Now smell like one. http://www.scrummaster-fragrance.com/