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
268 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 500 total points
ID: 39670862
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 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