Solved

how to identify whether to ask for the authentication or not i.e. if the user is accessing the application through internet or intranet?

Posted on 2013-11-20
5
257 Views
Last Modified: 2013-11-23
hi I am creating a website which is to be deployed on intranet as well as on internet.
If the website is accessed through internet then authentication is through Facebook and in the intranet it is without any authentication.

Question is how to identify whether to ask for the authentication or not i.e. if the user is accessing the application through internet or intranet?
0
Comment
Question by:Rocking
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:jb1dev
ID: 39663682
You mention little about your application or how it is accessed so I have to make some guesses here.

If you are using a web app / servlets, you can get the user's IP from the servlet request ServletRequest.getRemoteAddr()

see http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRemoteAddr%28%29

And then determine if that IP address is from your intranet or not.
0
 

Author Comment

by:Rocking
ID: 39667942
What if the url of both are same Or its not possible to that the url can be same?
0
 
LVL 14

Expert Comment

by:jb1dev
ID: 39667964
getRemoteAddr() returns the client IP regardless of what the URL is.
0
 

Author Comment

by:Rocking
ID: 39670854
getRemoteAddr() returns the client IP regardless of what the URL is.

if it is the case then how can we identify the browser url? i need to identify the url of the browser based on which can differentiate the intranet address or internet address.
0
 
LVL 14

Accepted Solution

by:
jb1dev earned 500 total points
ID: 39670862
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to dynamically set the form action using jQuery.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question