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
265 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generate Numbers in JQuery file 11 66
Json Schema 8 32
Phone Does Not Abide By CSS Breakpoint For Navigation Controls 6 20
Copying table data to one another 15 29
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

839 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