?
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
Medium Priority
?
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 total points
ID: 39670862
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

764 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