Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Professional Java for Web Applications
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Java for Web Applications
This is the forum to discuss the Wrox book Professional Java for Web Applications by Nicholas S. Williams; ISBN: 978-1-118-65646-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java for Web Applications section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2014, 03:44 AM
Authorized User
Points: 52, Level: 1
Points: 52, Level: 1 Points: 52, Level: 1 Points: 52, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 28 - Redirect URL for mobile App

Hi to all,
i'm trying to use the Rest Web Service built in the last chapter.

From iOS, i have requested the auth code and next clicked on "Accept" (like the client described in the same chapter").

Now, the chapter use as redirect url localhost:8080/client/support but, for example, if i would like to call this from an iOS App, what redirect url i should use?

I really dont understand this.

After having an "code", i dont have to call oauth/token with that code ?

If i call oauth/token, (with the code), the server reply me that i need a full authentication.....

I dont understand that step. Could someone help me?
Reply With Quote
  #2 (permalink)  
Old May 4th, 2014, 07:54 AM
Authorized User
Points: 52, Level: 1
Points: 52, Level: 1 Points: 52, Level: 1 Points: 52, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Someone have successfully used this application for example using RESTClient from Firefox ?

Using it with that client (or with other client) the error is:

<oauth><error_description>Full authentication is required to access this resource</error_description><error>unauthorized</error></oauth>

ps: but the author read this forum ??
Reply With Quote
  #3 (permalink)  
Old June 11th, 2014, 11:50 PM
Wrox Author
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2014
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

mistre83,

My apologies, but I finally have alerts set up for this forum. I should be able to follow it more closely now.

You can only use RESTClient (and similar tools) without OAuth. Once you add OAuth, you need a more complex testing tool (like a sample client) to use a protected web service. This is why the sample code for the chapter includes a standalone sample client intended to be used to test the web service.

As for using the web service from iOS, you'll need to make a few minor tweaks. First, for your iOS app, you'll need to register with iOS a unique URI scheme that indicates to the OS that your app should be opened when that URI is triggered. For example, the URI scheme for the Twitter app is "twitter://." I am not an iOS developer, so I couldn't tell you how to register this URI scheme.

Once you've done this, you'll need to add the iOS app client redirect URI to the WebServiceClient_RedirectUri database table. The default URI, as you pointed out, is http://localhost:8080/client/support (to which the authorization server will append the necessary parameters). Assuming the URI scheme you register with iOS is "myApp://" (that's a sample only), you could set the URI in the WebServiceClient_RedirectUri table to "myApp://oauth" or something similar.

Finally, whatever URI you put in the WebServiceClient_RedirectUri, you need to make sure your client includes the exact same URI in its initial forward to the authorization server.

This should get you going. Good luck working with this!
__________________
-- Nick Williams
Reply With Quote
  #4 (permalink)  
Old November 3rd, 2014, 09:33 AM
Authorized User
Points: 52, Level: 1
Points: 52, Level: 1 Points: 52, Level: 1 Points: 52, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2014
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Nick,

many thanks for your reply. What you say is exactly what i've already implemented :-)

The question that i havent already solved is posted here: Spring OAuth2 wrong redirect page

"Oauth2 wrong redirect page".

Thanks you again and... nice book!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Redirect based on given URL somnath.kartic VS.NET 2002/2003 1 August 2nd, 2012 08:21 AM
Redirect Url itHighway Classic ASP Basics 0 December 31st, 2009 10:50 AM
URL Redirect Help david29118 Classic ASP Basics 3 April 3rd, 2005 06:09 PM
file transfers over mobile asp.net web app badgolfer ASP.NET 1.0 and 1.1 Basics 1 November 15th, 2004 11:33 AM



All times are GMT -4. The time now is 01:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.