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
Related
I am trying to configure single sign-on feature of SAML 2.0 in my iOS application.
I have successfully configured Auth2.0 using MSAL iOS SDK.
Link: https://cocoapods.org/pods/MSAL
I have also looked into docs also.
LinkL: https://learn.microsoft.com/en-us/azure/active-directory/develop/single-sign-on-saml-protocol
But I am unable to figure out way to integrate SAML 2.0 by MSAL iOS sdk.
I am not sure whether MSAL iOS SDK provide support for SAML 2.0 integration or not.
In BASIC SAML Configuration section, I need to provide "identifier" and "Reply URL"
I am not sure, what I need to provide in these options. Currently in attached picture, I have used dummy url for now.
Pardon me for my poor grammar.
Does anyone know how to setup SAML 2.0 in iOS application.
I got the complete answer from Microsoft support.
If anyone want, then he/she can take a look on this url:
https://learn.microsoft.com/answers/questions/14212/setup-microsoft-azure-saml-20-into-ios-application.html
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.
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.
I would like to work with Google's .NET API while using OAuth 2.0 flow for devices.
I didn't find any way to use GoogleWebAuthorizationBroker or Create UserCredentials object in .NET when working with OAuth 2.0 flow for devices.
Is there a way to make the above requirement work? or should I use only REST API?
Thanks,
Ronen
Assuming you refer to this flow: https://developers.google.com/accounts/docs/OAuth2ForDevices, it is not supported in the Google APIs Client Library for .NET. So you need to build it yourself though you may be able to reuse large parts of Google's stuff.
Notice that the "OAuth 2.0 flow for devices" is not a standardized OAuth 2.0 flow, so support is not ubiquitous. Also, the Google says elsewhere:
If your app will run on devices that do not have access to a system
browser, or devices with limited input capabilities (for example, if
your app will run on game consoles, video cameras, or printers), then
see Using OAuth 2.0 for Devices.
If that's really your use case you should pursue my suggestions, otherwise you should switch to https://developers.google.com/accounts/docs/OAuth2InstalledApp (see the flow chart on the right side there as well).
The .NET client library for Google APIs supports OAuth 2.0 and it supports several devices including Windows Phone 8.1 and Windows Store applications.
The OAuth 2.0 documentation (including snippets) is available at: https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth.
My obvious recommendation is to use the library, because it will refresh tokens for you automatically (using the stored refresh token) and it's a light OO library which will do a lot of "magics" for you (such as media upload).
By the way, our samples repository includes full sample for a universal app, take a look at Blogger.Sample for more details.
I have a appcelerator titanium app, and I would like to use the same users and password for other apps, not related to appcelerator ACS or titanium, the question is: can I use appcelerator ACS as oauth for other applications?
I'm not familiar with ACS to much but from documentation I can find below:
it is not proffered as the ACS mention in its documentation
Your app must prove that it is allowed to talk to ACS. This keeps your
data secure by preventing anyone from making requests to ACS that
impersonate your app.
but you can create new app with new client-id as in ACS mention that:
You can integrate ACS into your application using the REST API, the
Titanium SDK, or the ACS native iOS and Android SDKs.
http://docs.appcelerator.com/cloud/latest/#!/guide/acs_quickstart
http://docs.appcelerator.com/cloud/latest/#!/guide/acs_authentication