Azure Mobile Services app crashes with message- The app is not configured correctly to use Live Connect services

0

*I am developing an store app .The ClientID and Client Secret on manage.dev.live.com have been copied to "identity" tab of my mobile services on Azure portal and the redirect domain on both the manage.dev and Azure portal do match. Also i have associated my store application with the app in manage.dev.live.com from inside VS . But still i am receiving an error in my app.*FYI i am using different live accounts for dev.live.com and for Azure Portal , i dont know if that has any effect. On putting breakpoint , the error occurs at following line -

 LiveLoginResult result = await liveidclient.LoginAsync(new[] { "wl.basic" });

BTW , i do get the login prompt to enter username and passwd .After clicking OK ,the app crashes with message -The app is not configured correctly to use Live Connect services. To configure your app, please follow the instructions on

Hi , this is my exception details-

Microsoft.Live.LiveAuthException was unhandled HResult=-2146233088 Message=The app is not configured correctly to use Live Connect services. To configure your app, please follow the instructions on http://go.microsoft.com/fwlink/?LinkId=220871. Source=Microsoft.Live ErrorCode=invalid_request StackTrace: at Microsoft.Live.LiveAuthClient.d_4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at DeltaVMobile.MainPage.<Authenticate>d__4.MoveNext() in MainPage.xaml.cs:line 99 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at DeltaVMobile.MainPage.<OnNavigatedTo>d__0.MoveNext() in MainPage.xaml.cs:line 75 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state) at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() InnerException: HResult=-2138701823 Message=Authentication target is invalid or not configured correctly. (Exception from HRESULT: 0x80860001) Source=mscorlib StackTrace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.Live.TailoredAuthClient.d_12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.Live.TailoredAuthClient.d__0.MoveNext() InnerException:

The following is the code i am using

LiveAuthClient liveidclient = new LiveAuthClient("https://deltavauth.azure-mobile.net/");

            while (session == null)
            {
                if (liveidclient.CanLogout)
                {
                    liveidclient.Logout();
                }

                LiveLoginResult result = await liveidclient.LoginAsync(new[] { "wl.basic" });
                if (result.Status == LiveConnectSessionStatus.Connected)
                {
                    session = result.Session;
                    LiveConnectClient client = new LiveConnectClient(result.Session);
                    LiveOperationResult mresult = await client.GetAsync("me");
                    MobileServiceUser loginresult = await App.MobileService.LoginWithMicrosoftAccountAsync(result.Session.AuthenticationToken);
                    string title = string.Format("Welcome {0} !", mresult.Result["first_name"]);
                    var message = string.Format("You are now logged in -{0}", loginresult.UserId);
                    var dialog = new MessageDialog(title);
                    dialog.Commands.Add(new UICommand("OK"));
                    await dialog.ShowAsync();

                }
                else
                {
                    session = null;
                    var dialog = new MessageDialog("You must login to use DeltaV", "Login Required");
                    dialog.Commands.Add(new UICommand("OK"));
                    await dialog.ShowAsync();
                }

FYI , this is the URL for the tutorial -http://www.windowsazure.com/en-us/develop/mobile/tutorials/single-sign-on-windows-8-dotnet/.

azure
windows-8
azure-mobile-services
asked on Stack Overflow Jun 7, 2013 by Boncek35 • edited Jun 7, 2013 by astaykov

1 Answer

2

https://manage.dev.live.com/ is deprecated

You need to associate your app to your Windows Store account then and then you can use Live services & push notifications.

  1. Right click on project name.
  2. Click on "Store" menu.
  3. Click "Associate App with the Store".
  4. It will prompt you for login. Do login with your store account.
  5. Click on the reserved name of your app (I think you must have reserved your app name otherwise go to Windows Store Dashboard and first reserve it.)
  6. Follow the other process which prompts.
  7. You project will get Store Key & new Package Identity. So it will allow you to leverage Live services & push notifications.
answered on Stack Overflow Jun 7, 2013 by Farhan Ghumra • edited Jun 7, 2013 by Farhan Ghumra

User contributions licensed under CC BY-SA 3.0