A JBoss Project
Red Hat

Latest posts

In this article, I’m happy to introduce you the OAuth authorization via Phonegap’s inAppBrowser plugin with CordovaSim.

I was inspired to write this blog after reading a great article about Google API OAuth with PhoneGap’s InAppBrowser by Michael Dellanoce. I also want to spill the beans about new CordovaSim’s features like: JavaFx web engine, hybrid app debugging and eclipse console logging, that will be available in Beta3 (but you can try them now from the nightly build 4.2.x update site).

Overview

OAuth is an open standard for authorization. It specifies a process for resource owners to authorize third-party access to their server resources without sharing their credentials. Designed specifically to work with Hypertext Transfer Protocol (HTTP), OAuth essentially allows access tokens to be issued to third-party clients by an authorization server, with the approval of the resource owner, or end-user. PhoneGap Developers use inAppBrowser’s API to show the OAuth consent page.

Demo

CordovaSim supports inAppBrowser plugin and handles OAuth authorization. Here is a short video with OAuth demo and brand-new CordovaSim’s features (source code is also taken from the Michael Dellanoce’s article):

How to give it a go?

The sample should work with JBoss Tools 4.2.0 Beta3 release and later versions.

  • Clone the demo project

  • File → Import → Import Cordova Project

  • Right-click on the project → Properties → Hybrid Mobile Engine → Download → 3.4.0 (select as default engine)

  • Create a Google Developers Console project

  • Copy and paste Client ID and Client secret to index.js (lines 80-81) of the hybrid project

  • Right-click on the project → Run As.. → Run with CordovaSim

A few things to notice here : first, the Hybrid Mobile Tools imports the project into Eclipse and configures the proper plugins without there being any Eclipse specfic setup in the project. This works because the project is following the conventions from Cordova CLI generated projects and the import wizard understands this.

Secondly, when using Java 8, you can connect the Chrome debugger to the CordovaSimulator (Right click → Debug on browser) allowing you to step through the code, introspect variables and so forth.

Conclusion

We are trying our best to make CordovaSim as good as possible. User feedback is what we are seeking for now. We are looking forward to hearing your comments / remarks!
Have fun!

Ilya Buziuk
@ilyabuziuk

I believe very much in our tools are only as good as our users think they are.

Today I’m calling out to you reading this blog to help us make the tools better.

As Thanks you get better tools that works better with your usecases!

Today we are introducing JBoss Tools Community Acceptance Testing (CAT) program to make sure we hear from you to know what is working and what is not working.

JBoss Tools CAT Logo

What is it ?

JBoss Tools CAT is a program where you signup and give feedback on new features and we will help you in any issues you have. We’ll also be doing some surveys where JBoss Tools CAT members get to tell us if you find JBoss Tools are ready to be released or not.

The program will run for every major release, this time we are focusing on JBoss Tools 4.2 and Developer Studio 8.0 - current release for that is 4.2.0.Beta2

You can see the details about the program at the CAT page.

How do I participate ?

If you are interested in participating please go and Register!

Is this not similar to NetBeans CAT ?

Yes, the Netbeans CAT program is what inspired us to do this. We think it will work equally well for us too.

What is in it for you ?

Besides you being able to influence the readyness of JBoss Tools for your usecases we will also at the release of the final JBoss Tools put your name as part of the release and dependent on the number of participants give out some extra prizes.

You can see more at the JBoss Tools CAT web page.

Again, if you are interested in helping making the tools work better for you, please Register!

Lets Have fun!

Max Rydahl Andersen
@maxandersen

Looking for older posts ? See the Archived entries.
back to top