Azure Mobile Service OAuth in Xamarin.iOS - ios

I am Creating a Xamarin Native project for iOS and Android. I am using Microsoft Azure as my backend and azure OAuth for authentication. I added Microsoft Azure Mobile Client to both iOs and Android project.
In Xamarin.Android Project, I did authentication with azure with following code:
MobileServiceClient client = new MobileServiceClient("my-azure-app-url");
var user = client.LoginAsync(this, MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory);
Above Code works fine and i am able to do authentication.
Same i tried in Xamain.iOS also but i can to know the initialisation of MobileServiceClient is different in iOs.
MobileServiceClient client = new MobileServiceClient("my-azure-app-url", HttpMessageHandler);
I am not able to find what is this HttpMessageHandler. Can any one help me with the solution

An HTTP message handler is responsible for the actual communication going on between client and server.
There is a default (managed) implementation that will be used if you do not specify a handler. But you could go ahead and tell HttpClient to use a native one on iOS (as well as Android). You could use ModernHttpClient or use Xamarin Studio to configure the use of NSUrlSession (on iOS). I highly recommend to use a native handler to support IPv6 environments and to increase performance.
In your case, you would either omit the handler parameter or use a new System.Net.Http.HttpMessageHandler().
If you add ModernHttpClient into your app, you would pass in a new NativeMessageHandler().
An example can be found in my repo about Azure offline syncing.

I had a similar issue setting up Azure Mobile Service with my Xamarin project. I managed to succeed in establishing the Mobile Service Client after numerous updates and removals of the Microsoft.Azure.Mobile.Client package(s).
I am using the exact same initialization on both the .Droid and the .iOS project:
public static MobileServiceClient mobileservice = new MobileServiceClient("my-azure-app-url");
Packages attached to both the .Droid and the .iOS project:
Microsoft.Azure.Mobile.Client (ver 2.0.1)
Microsoft.Bcl (ver 1.1.10)
Microsoft.Bcl.Build (ver 1.0.21)
Microsoft.Net.Http (ver 2.2.29)
As far as I understood, it all came down to an incompatibility between some packages. I could definitely not get the Azure Mobile Service from the Component store to work. If this is what you've used, try installing the packages manually. In the end, that's what worked for me.

Related

How to build Oauth 2.0 using Appcelerator Titanium in Android

How to build Oauth2.0 using Appcelerator Titanium in Andriod any one please help me.
Oauth can be implemented using normal createHTTPClient requests. You have to use a standard login-flow and provide needed headers/parameters (see the Oauth specifications).
If you don't want to create a module on your own you can have a look at the
commonjs module available at https://github.com/appcelerator-modules/ti.oauth

Developing Mobile Native iOS applications to intergrate with SAP middleware

I am currently involved in defining strategy for a large future project, where it is proposed to developed native mobile phone applications that would integrate with SAP middleware.
I would like to understand how one would develop a native iOS mobile app that would communicate with SAP NetWeaver, using Odata?
Regards.
You can create server side OData service and communicate with it from mobile app by http/https protocol.
OData supports both JSON and XML formats.
If your application is rather simple - common BSP application can be used. It works faster but a little bit harder to develop complex application.
Odata is an open standard, there are libraries that you could use in your ios project hence you could consume the Odata service in your app. It is just another HTTP/HTTPS request-response.
SAP gateway expose Odata service
Consume that in the app using open source libraries available.
Another option:
Use SAP mobile platform 3 (a product from SAP to mobilise enterprise) to develop native and hybrid apps. It supports all major mobile platforms like iOS, windows and android.
It has an SDK which provides all enterprise level features to your app - offline support, SSO, different authentication mechanisms like LDAP and 509 certificate etc.
SAP also provides cloud based solution as well it is called Hana cloud platform mobile services.

AWS Mobile without the SDK

Is it possible to use the AWS mobile services (Cognito, Analytics, etc) without linking all the SDK in an Xcode project?
Background:
* While I am not new to AWS nor mobile programming, the following case is challenging:
We are shipping a mobile "framework" (not app) that uses our AWS for some parts (Authentication, logs).
And, as the AWS SDK has to be linked in the app project itself, this will require us asking all the clients (developers) to download and link it in their own projects.
What is used in the framework is just one request for authentication and one for logging (success/failure, disconnection), so no need for all the SDK.
I wonder if there is a possibility to request AWS services without linking against the SDK?
I know it's possible to put then under an umbrella SDK, or do some cherry picking from their git repository, but both of these seem like overkill.
As the request itself is a simple URL with Get/Post, is there a possibility (or tutorial) on constructing the request manually via NSURLConnexion/NSURLSession, etc?
Thank you
Talking to the AWS APIs is actually not that hard. The main difficulty is signing your http requests, and that's not nearly as bad as it sounds. Which leaves xml parsing accounting for most of the unpleasantness.
I've done it in go. The most informative part is probably the signing tests.
Indeed, it is possible. You will have to code calls to AWS at the REST level. Everything you need is in the documentation of AWS.
For instance, if you needed to execute actions on EC2, here's what you'd have to code:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#structure-of-a-get-request
You can call the HTTP APIs directly. Since the AWS Mobile SDK for iOS and Android are open source, you can look at them directly. Find the AWS Mobile SDK for iOS Source on Github, and the AWS Mobile SDK for Android on Github. Since you mentioned you need authentication request on iOS I am guessing you're looking for the Cognito Identity in AWSCore source.

iOS and salesforce API connection

Hello I am new in WSDL salesforce API integration in iOS. And I got some WSDL to OBJC library files included into xcode project. And my first task is to go with app login screen. And as per android version we need to connect salesforce api with our app using :
ConnectorConfig config = new ConnectorConfig();
config.setUsername(username);
config.setPassword(password);
config.setAuthEndpoint(authEndPoint);
config.setTraceMessage(true);
config.setPrettyPrintXml(true);
partnerConnection = Connector.newConnection(config);
And in the response received sessionID. and set to sessionHeader.
So I think, I need same thing in iOS version. So please guide me to access the salesforce webservices.
Your best bet it to use a pre-existing SDK for Salesforce that is for iOS, rather than trying to map from some java/android code. Check out the Salesforce iOS SDK or ZKSforce

iOS App Authentication with Windows Azure AD

Is this possible to authentice iOS Mobile App with Windows Azure Active Directory(AD) with utilizing mobile web services of Azure.
Basically iOS App should be login with only the Windows Azure Active Directory(AD)
I found one third party library
https://github.com/MSOpenTech/azure-activedirectory-library-for-ios/
but not sure whether this is secured or should be used or not
Microsoft Open Technologies (MSOpenTech on Github) is Micrsoft's official approach to helping open source communities both on and off the Microsoft platform. This should give you confidence in the legitimacy of the code on Github. See here for more details: https://msopentech.com/

Resources