OpenAM | Mirror of https://stash.forgerock.org/projects/OPENAM/openam

 by   OpenRock Java Updated: 8 months ago - 13.0.0 License: No License

Download this library from

Build Applications

kandi X-RAY | OpenAM REVIEW AND RATINGS

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright (c) 2011-2012 ForgeRock AS Inc. All Rights Reserved. This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. You can also obtain a copy of the license at src/main/resources/legal-notices/CC-BY-NC-ND.txt. See the License for the specific language governing permissions and limitations under the License. If applicable, add the following below this CCPL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner].

kandi-support
Support

  • OpenAM has a low active ecosystem.
  • It has 138 star(s) with 176 fork(s).
  • It had no major release in the last 12 months.
  • It has a neutral sentiment in the developer community.

quality kandi
Quality

  • OpenAM has 20714 bugs (163 blocker, 13 critical, 19337 major, 1201 minor) and 134692 code smells.

security
Security

  • OpenAM has 4 vulnerability issues reported (0 critical, 3 high, 1 medium, 0 low).
  • OpenAM code analysis shows 18 unresolved vulnerabilities (9 blocker, 7 critical, 2 major, 0 minor).
  • There are 501 security hotspots that need review.

license
License

  • OpenAM does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.

build
Reuse

  • OpenAM releases are available to install and integrate.
  • Build file is available. You can build the component from source.
  • OpenAM saves you 3591608 person hours of effort in developing the same functionality from scratch.
  • It has 1342440 lines of code, 78521 functions and 11077 files with 0 % test coverage
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
Top functions reviewed by kandi - BETA

kandi has reviewed OpenAM and discovered the below as its top functions. This is intended to give you an instant insight into OpenAM implemented functionality, and help decide if they suit your requirements.

  • set attributes
  • returns a list of records
  • Extract process request .
  • Create the SAML response .
  • Process authentication xml request .
  • Create a FSASSert instance
  • Process response .
  • Process logout request .
  • Forward to the login request .
  • Walk the node .

OpenAM Key Features

Mirror of https://stash.forgerock.org/projects/OPENAM/openam

OpenAM examples and code snippets

  • Portions Copyrighted 2010-2012 ForgeRock US
  • how to hide other markers after display direction on google map
  • OIDC reverse proxy sidecar in kubernetes
  • Spring Security 5.2 -- how to customize NimbusJWTDecoder used by OAuth2ResourceServer?
  • SignOut does not redirect to site home page
  • OpenAm how to redirect to template in callback (proceess method)
  • OpenAM - Getting a Session attribute into an OpenID Connect claim
  • Grafana Integration with Identity Provider using openid connect and generic oauth
  • CASE WHEN with COLLECT_SET
  • idRepo filesize slowly growing to large
  • Start Tomcat on reboot with different user

Portions Copyrighted 2010-2012 ForgeRock US

%% 1. Maven build requirements and structure
    %% 1.1 Build requirements
    %% 2.2 Maven structure

%% 2. Library dependencies

%% 3. Building the workspace

how to hide other markers after display direction on google map

function initMap() {
   var directionsService = new google.maps.DirectionsService();
   var chicago = new google.maps.LatLng(41.85, -87.65);
   var directionsDisplay = new google.maps.DirectionsRenderer();
   var map = new google.maps.Map(document.getElementById('distance-map'), {
      zoom: 5.2,
      center: chicago
   });
   directionsDisplay.setMap(map);

   var onChangeHandler = function() {
      calculateAndDisplayRoute(directionsService, directionsDisplay);
   };
   document.getElementById('start').addEventListener('change', onChangeHandler);
   document.getElementById('end').addEventListener('change', onChangeHandler);
}

function calculateAndDisplayRoute(directionsService, directionsDisplay) {
   directionsService.route({
      origin: document.getElementById('start').value,
      destination: document.getElementById('end').value,
      travelMode: 'DRIVING'
   }, function(response, status) {
      if (status === 'OK') {
         directionsDisplay.setDirections(response);
      } else {
         window.alert('Directions request failed due to ' + status);
      }
   });
}
#distance-map {
  height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#floating-panel {
  position: absolute;
  top: 10px;
  left: 25%;
  z-index: 5;
  background-color: #fff;
  padding: 5px;
  border: 1px solid #999;
  text-align: center;
  font-family: 'Roboto','sans-serif';
  line-height: 30px;
  padding-left: 10px;
}
#warnings-panel {
  width: 100%;
  height:10%;
  text-align: center;
}
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>JS Bin</title>
   </head>
   <body>
   <br />
      <div id="distance-panel">
         Start:
         <select id="start">
            <option value='41.878114,-87.629798'>Chicago</option>
            <option value='42.331427,-83.045754'>Detroit</option>
            <option value='39.099727,-94.578567'>Kansas City</option>
            <option value='41.600545,-93.609106'>Des Molines</option>
         </select>
         End:
         <select id="end">
            <option value='38.833882,-104.821363'>Colorado Springs</option>
            <option value='36.162664,-86.781602'>Nashville</option>
            <option value='39.768403,-86.158068'>Indianapolis</option>
            <option value='36.162664,-86.781602'>Nashville</option>
         </select>
      </div>
      <br />
      <div id="distance-map"></div>
      <script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLHKWYAEE2PDjvt6BaBH1SIs4Q93PMpQs&callback=initMap">
</script>
   </body>
</html>
-----------------------
function initMap() {
   var directionsService = new google.maps.DirectionsService();
   var chicago = new google.maps.LatLng(41.85, -87.65);
   var directionsDisplay = new google.maps.DirectionsRenderer();
   var map = new google.maps.Map(document.getElementById('distance-map'), {
      zoom: 5.2,
      center: chicago
   });
   directionsDisplay.setMap(map);

   var onChangeHandler = function() {
      calculateAndDisplayRoute(directionsService, directionsDisplay);
   };
   document.getElementById('start').addEventListener('change', onChangeHandler);
   document.getElementById('end').addEventListener('change', onChangeHandler);
}

function calculateAndDisplayRoute(directionsService, directionsDisplay) {
   directionsService.route({
      origin: document.getElementById('start').value,
      destination: document.getElementById('end').value,
      travelMode: 'DRIVING'
   }, function(response, status) {
      if (status === 'OK') {
         directionsDisplay.setDirections(response);
      } else {
         window.alert('Directions request failed due to ' + status);
      }
   });
}
#distance-map {
  height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#floating-panel {
  position: absolute;
  top: 10px;
  left: 25%;
  z-index: 5;
  background-color: #fff;
  padding: 5px;
  border: 1px solid #999;
  text-align: center;
  font-family: 'Roboto','sans-serif';
  line-height: 30px;
  padding-left: 10px;
}
#warnings-panel {
  width: 100%;
  height:10%;
  text-align: center;
}
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>JS Bin</title>
   </head>
   <body>
   <br />
      <div id="distance-panel">
         Start:
         <select id="start">
            <option value='41.878114,-87.629798'>Chicago</option>
            <option value='42.331427,-83.045754'>Detroit</option>
            <option value='39.099727,-94.578567'>Kansas City</option>
            <option value='41.600545,-93.609106'>Des Molines</option>
         </select>
         End:
         <select id="end">
            <option value='38.833882,-104.821363'>Colorado Springs</option>
            <option value='36.162664,-86.781602'>Nashville</option>
            <option value='39.768403,-86.158068'>Indianapolis</option>
            <option value='36.162664,-86.781602'>Nashville</option>
         </select>
      </div>
      <br />
      <div id="distance-map"></div>
      <script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLHKWYAEE2PDjvt6BaBH1SIs4Q93PMpQs&callback=initMap">
</script>
   </body>
</html>
-----------------------
function initMap() {
   var directionsService = new google.maps.DirectionsService();
   var chicago = new google.maps.LatLng(41.85, -87.65);
   var directionsDisplay = new google.maps.DirectionsRenderer();
   var map = new google.maps.Map(document.getElementById('distance-map'), {
      zoom: 5.2,
      center: chicago
   });
   directionsDisplay.setMap(map);

   var onChangeHandler = function() {
      calculateAndDisplayRoute(directionsService, directionsDisplay);
   };
   document.getElementById('start').addEventListener('change', onChangeHandler);
   document.getElementById('end').addEventListener('change', onChangeHandler);
}

function calculateAndDisplayRoute(directionsService, directionsDisplay) {
   directionsService.route({
      origin: document.getElementById('start').value,
      destination: document.getElementById('end').value,
      travelMode: 'DRIVING'
   }, function(response, status) {
      if (status === 'OK') {
         directionsDisplay.setDirections(response);
      } else {
         window.alert('Directions request failed due to ' + status);
      }
   });
}
#distance-map {
  height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#floating-panel {
  position: absolute;
  top: 10px;
  left: 25%;
  z-index: 5;
  background-color: #fff;
  padding: 5px;
  border: 1px solid #999;
  text-align: center;
  font-family: 'Roboto','sans-serif';
  line-height: 30px;
  padding-left: 10px;
}
#warnings-panel {
  width: 100%;
  height:10%;
  text-align: center;
}
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>JS Bin</title>
   </head>
   <body>
   <br />
      <div id="distance-panel">
         Start:
         <select id="start">
            <option value='41.878114,-87.629798'>Chicago</option>
            <option value='42.331427,-83.045754'>Detroit</option>
            <option value='39.099727,-94.578567'>Kansas City</option>
            <option value='41.600545,-93.609106'>Des Molines</option>
         </select>
         End:
         <select id="end">
            <option value='38.833882,-104.821363'>Colorado Springs</option>
            <option value='36.162664,-86.781602'>Nashville</option>
            <option value='39.768403,-86.158068'>Indianapolis</option>
            <option value='36.162664,-86.781602'>Nashville</option>
         </select>
      </div>
      <br />
      <div id="distance-map"></div>
      <script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLHKWYAEE2PDjvt6BaBH1SIs4Q93PMpQs&callback=initMap">
</script>
   </body>
</html>
-----------------------
function hideMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();  // <========================= call it here
    }
  });
  displayLocation(hakim);
}
var gmarkers = [];

var map;
var directionsService;
var directionsDisplay;
var geocoder;
var infowindow;

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function init() {
  directionsService = new google.maps.DirectionsService();
  directionsDisplay = new google.maps.DirectionsRenderer();
  geocoder = new google.maps.Geocoder();
  infowindow = new google.maps.InfoWindow();

  /*++++++++++++++++++*/

  var mapOptions = {
    zoom: 6,
    center: center = new google.maps.LatLng(32, -6),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  /*++++++++++++++++++*/

  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  directionsDisplay.setMap(map);
  directionsDisplay.setPanel(document.getElementById('directions_panel'));

  // Detect user location
  if (navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function(position) {
      var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      geocoder.geocode({
        'latLng': userLocation
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          document.getElementById('start').value = results[0].formatted_address
        }
      });

    }, function() {
      alert('Geolocation is supported, but it failed');
    });
  }

  /*++++++++++++++++++*/

  makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    var data = JSON.parse(data.responseText);
    var selectBox = document.getElementById('destination');

    for (var i = 0; i < data.length; i++) {
      displayLocation(data[i]);
      addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
    }
  });
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function hideMarkers() {
  console.log("gmarkers.length=" + gmarkers.length);
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function addOption(selectBox, text, value) {
  var option = document.createElement("OPTION");
  option.text = text;
  option.value = value;
  selectBox.options.add(option);
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  console.log("selected option value=" + destination);
  console.log(" value=" + hakim);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  console.log("origin:" + start);
  console.log("dest:" + destination.toUrlValue(12));
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();
    }
  });
  displayLocation(hakim);
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function makeRequest(url, callback) {
  var request;
  if (window.XMLHttpRequest) {
    request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
  } else {
    request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
  }
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      callback(request);
    }
  }
  request.open("GET", url, true);
  request.send();
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


function displayLocation(rythmstu_innotec) {
  var content = '<div class="infoWindow"><strong> Code Client : ' + rythmstu_innotec.CodeClient + '</strong>' +
    '<br />Latitude : ' + rythmstu_innotec.Latitude +
    '<br />Longitude : ' + rythmstu_innotec.Longitude +
    '<br />Route : ' + rythmstu_innotec.Route +
    '<br />Secteur : ' + rythmstu_innotec.Secteur +
    '<br />Agence : ' + rythmstu_innotec.Agence +
    '<br />prenom de Client : ' + rythmstu_innotec.PrenomClient +
    '<br />Num Adresse : ' + rythmstu_innotec.NumAdresse +
    '<br />GeoAdresse : ' + rythmstu_innotec.GeoAdresse +
    '<br />Téléphone : ' + rythmstu_innotec.Tel +
    '<br />Whatsapp : ' + rythmstu_innotec.Whatsapp +
    '<br />Nbr Frigos : ' + rythmstu_innotec.NbrFrigo +
    '<br />Ouverture Matin : ' + rythmstu_innotec.OpenAm +
    '<br />Fermeture Matin : ' + rythmstu_innotec.CloseAm +
    '<br />Ouverture après-midi : ' + rythmstu_innotec.OpenPm +
    '<br />Fermeture Après-midi : ' + rythmstu_innotec.ClosePm + '</div>';

  if (parseInt(rythmstu_innotec.Latitude) == 0) {
    geocoder.geocode({
      'GeoAdresse': rythmstu_innotec.GeoAdresse
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.rythmstu_innotec,
          title: rythmstu_innotec.name
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });
      }
    });
  } else {
    var position = new google.maps.LatLng(parseFloat(rythmstu_innotec.Latitude), parseFloat(rythmstu_innotec.Longitude));
    var marker = new google.maps.Marker({
      map: map,
      position: position,
      title: rythmstu_innotec.name
    });
    gmarkers.push(marker);

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(content);
      infowindow.open(map, marker);
    });
  }
}
body {
  font: normal 14px Verdana;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

#sidebar {
  float: right;
  width: 30%;
}

#main {
  padding-right: 15px;
}

.infoWindow {
  width: 220px;
}
<title>MAP itinéraire </title>
<meta charset="utf-8">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

<body onload="init();">

  <form id="services">
    Location: <input type="text" id="start" value="Midar" /> Destination:
    <select id="destination" onchange="calculateRoute();"></select>
    <input type="button" value="clear map" onclick="toggleMarkers();" />
  </form>

  <section id="sidebar">
    <div id="directions_panel"></div>
  </section>

  <section id="main">
    <div id="map_canvas" style="width: 70%; height: 750px;"></div>
  </section>

</body>
-----------------------
function hideMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();  // <========================= call it here
    }
  });
  displayLocation(hakim);
}
var gmarkers = [];

var map;
var directionsService;
var directionsDisplay;
var geocoder;
var infowindow;

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function init() {
  directionsService = new google.maps.DirectionsService();
  directionsDisplay = new google.maps.DirectionsRenderer();
  geocoder = new google.maps.Geocoder();
  infowindow = new google.maps.InfoWindow();

  /*++++++++++++++++++*/

  var mapOptions = {
    zoom: 6,
    center: center = new google.maps.LatLng(32, -6),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  /*++++++++++++++++++*/

  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  directionsDisplay.setMap(map);
  directionsDisplay.setPanel(document.getElementById('directions_panel'));

  // Detect user location
  if (navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function(position) {
      var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      geocoder.geocode({
        'latLng': userLocation
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          document.getElementById('start').value = results[0].formatted_address
        }
      });

    }, function() {
      alert('Geolocation is supported, but it failed');
    });
  }

  /*++++++++++++++++++*/

  makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    var data = JSON.parse(data.responseText);
    var selectBox = document.getElementById('destination');

    for (var i = 0; i < data.length; i++) {
      displayLocation(data[i]);
      addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
    }
  });
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function hideMarkers() {
  console.log("gmarkers.length=" + gmarkers.length);
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function addOption(selectBox, text, value) {
  var option = document.createElement("OPTION");
  option.text = text;
  option.value = value;
  selectBox.options.add(option);
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  console.log("selected option value=" + destination);
  console.log(" value=" + hakim);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  console.log("origin:" + start);
  console.log("dest:" + destination.toUrlValue(12));
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();
    }
  });
  displayLocation(hakim);
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function makeRequest(url, callback) {
  var request;
  if (window.XMLHttpRequest) {
    request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
  } else {
    request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
  }
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      callback(request);
    }
  }
  request.open("GET", url, true);
  request.send();
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


function displayLocation(rythmstu_innotec) {
  var content = '<div class="infoWindow"><strong> Code Client : ' + rythmstu_innotec.CodeClient + '</strong>' +
    '<br />Latitude : ' + rythmstu_innotec.Latitude +
    '<br />Longitude : ' + rythmstu_innotec.Longitude +
    '<br />Route : ' + rythmstu_innotec.Route +
    '<br />Secteur : ' + rythmstu_innotec.Secteur +
    '<br />Agence : ' + rythmstu_innotec.Agence +
    '<br />prenom de Client : ' + rythmstu_innotec.PrenomClient +
    '<br />Num Adresse : ' + rythmstu_innotec.NumAdresse +
    '<br />GeoAdresse : ' + rythmstu_innotec.GeoAdresse +
    '<br />Téléphone : ' + rythmstu_innotec.Tel +
    '<br />Whatsapp : ' + rythmstu_innotec.Whatsapp +
    '<br />Nbr Frigos : ' + rythmstu_innotec.NbrFrigo +
    '<br />Ouverture Matin : ' + rythmstu_innotec.OpenAm +
    '<br />Fermeture Matin : ' + rythmstu_innotec.CloseAm +
    '<br />Ouverture après-midi : ' + rythmstu_innotec.OpenPm +
    '<br />Fermeture Après-midi : ' + rythmstu_innotec.ClosePm + '</div>';

  if (parseInt(rythmstu_innotec.Latitude) == 0) {
    geocoder.geocode({
      'GeoAdresse': rythmstu_innotec.GeoAdresse
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.rythmstu_innotec,
          title: rythmstu_innotec.name
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });
      }
    });
  } else {
    var position = new google.maps.LatLng(parseFloat(rythmstu_innotec.Latitude), parseFloat(rythmstu_innotec.Longitude));
    var marker = new google.maps.Marker({
      map: map,
      position: position,
      title: rythmstu_innotec.name
    });
    gmarkers.push(marker);

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(content);
      infowindow.open(map, marker);
    });
  }
}
body {
  font: normal 14px Verdana;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

#sidebar {
  float: right;
  width: 30%;
}

#main {
  padding-right: 15px;
}

.infoWindow {
  width: 220px;
}
<title>MAP itinéraire </title>
<meta charset="utf-8">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

<body onload="init();">

  <form id="services">
    Location: <input type="text" id="start" value="Midar" /> Destination:
    <select id="destination" onchange="calculateRoute();"></select>
    <input type="button" value="clear map" onclick="toggleMarkers();" />
  </form>

  <section id="sidebar">
    <div id="directions_panel"></div>
  </section>

  <section id="main">
    <div id="map_canvas" style="width: 70%; height: 750px;"></div>
  </section>

</body>
-----------------------
function hideMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();  // <========================= call it here
    }
  });
  displayLocation(hakim);
}
var gmarkers = [];

var map;
var directionsService;
var directionsDisplay;
var geocoder;
var infowindow;

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function init() {
  directionsService = new google.maps.DirectionsService();
  directionsDisplay = new google.maps.DirectionsRenderer();
  geocoder = new google.maps.Geocoder();
  infowindow = new google.maps.InfoWindow();

  /*++++++++++++++++++*/

  var mapOptions = {
    zoom: 6,
    center: center = new google.maps.LatLng(32, -6),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  /*++++++++++++++++++*/

  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  directionsDisplay.setMap(map);
  directionsDisplay.setPanel(document.getElementById('directions_panel'));

  // Detect user location
  if (navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function(position) {
      var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      geocoder.geocode({
        'latLng': userLocation
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          document.getElementById('start').value = results[0].formatted_address
        }
      });

    }, function() {
      alert('Geolocation is supported, but it failed');
    });
  }

  /*++++++++++++++++++*/

  makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    var data = JSON.parse(data.responseText);
    var selectBox = document.getElementById('destination');

    for (var i = 0; i < data.length; i++) {
      displayLocation(data[i]);
      addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
    }
  });
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function hideMarkers() {
  console.log("gmarkers.length=" + gmarkers.length);
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function addOption(selectBox, text, value) {
  var option = document.createElement("OPTION");
  option.text = text;
  option.value = value;
  selectBox.options.add(option);
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  console.log("selected option value=" + destination);
  console.log(" value=" + hakim);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  console.log("origin:" + start);
  console.log("dest:" + destination.toUrlValue(12));
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();
    }
  });
  displayLocation(hakim);
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function makeRequest(url, callback) {
  var request;
  if (window.XMLHttpRequest) {
    request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
  } else {
    request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
  }
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      callback(request);
    }
  }
  request.open("GET", url, true);
  request.send();
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


function displayLocation(rythmstu_innotec) {
  var content = '<div class="infoWindow"><strong> Code Client : ' + rythmstu_innotec.CodeClient + '</strong>' +
    '<br />Latitude : ' + rythmstu_innotec.Latitude +
    '<br />Longitude : ' + rythmstu_innotec.Longitude +
    '<br />Route : ' + rythmstu_innotec.Route +
    '<br />Secteur : ' + rythmstu_innotec.Secteur +
    '<br />Agence : ' + rythmstu_innotec.Agence +
    '<br />prenom de Client : ' + rythmstu_innotec.PrenomClient +
    '<br />Num Adresse : ' + rythmstu_innotec.NumAdresse +
    '<br />GeoAdresse : ' + rythmstu_innotec.GeoAdresse +
    '<br />Téléphone : ' + rythmstu_innotec.Tel +
    '<br />Whatsapp : ' + rythmstu_innotec.Whatsapp +
    '<br />Nbr Frigos : ' + rythmstu_innotec.NbrFrigo +
    '<br />Ouverture Matin : ' + rythmstu_innotec.OpenAm +
    '<br />Fermeture Matin : ' + rythmstu_innotec.CloseAm +
    '<br />Ouverture après-midi : ' + rythmstu_innotec.OpenPm +
    '<br />Fermeture Après-midi : ' + rythmstu_innotec.ClosePm + '</div>';

  if (parseInt(rythmstu_innotec.Latitude) == 0) {
    geocoder.geocode({
      'GeoAdresse': rythmstu_innotec.GeoAdresse
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.rythmstu_innotec,
          title: rythmstu_innotec.name
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });
      }
    });
  } else {
    var position = new google.maps.LatLng(parseFloat(rythmstu_innotec.Latitude), parseFloat(rythmstu_innotec.Longitude));
    var marker = new google.maps.Marker({
      map: map,
      position: position,
      title: rythmstu_innotec.name
    });
    gmarkers.push(marker);

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(content);
      infowindow.open(map, marker);
    });
  }
}
body {
  font: normal 14px Verdana;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

#sidebar {
  float: right;
  width: 30%;
}

#main {
  padding-right: 15px;
}

.infoWindow {
  width: 220px;
}
<title>MAP itinéraire </title>
<meta charset="utf-8">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

<body onload="init();">

  <form id="services">
    Location: <input type="text" id="start" value="Midar" /> Destination:
    <select id="destination" onchange="calculateRoute();"></select>
    <input type="button" value="clear map" onclick="toggleMarkers();" />
  </form>

  <section id="sidebar">
    <div id="directions_panel"></div>
  </section>

  <section id="main">
    <div id="map_canvas" style="width: 70%; height: 750px;"></div>
  </section>

</body>
-----------------------
function hideMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();  // <========================= call it here
    }
  });
  displayLocation(hakim);
}
var gmarkers = [];

var map;
var directionsService;
var directionsDisplay;
var geocoder;
var infowindow;

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function init() {
  directionsService = new google.maps.DirectionsService();
  directionsDisplay = new google.maps.DirectionsRenderer();
  geocoder = new google.maps.Geocoder();
  infowindow = new google.maps.InfoWindow();

  /*++++++++++++++++++*/

  var mapOptions = {
    zoom: 6,
    center: center = new google.maps.LatLng(32, -6),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  /*++++++++++++++++++*/

  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  directionsDisplay.setMap(map);
  directionsDisplay.setPanel(document.getElementById('directions_panel'));

  // Detect user location
  if (navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function(position) {
      var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      geocoder.geocode({
        'latLng': userLocation
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          document.getElementById('start').value = results[0].formatted_address
        }
      });

    }, function() {
      alert('Geolocation is supported, but it failed');
    });
  }

  /*++++++++++++++++++*/

  makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    var data = JSON.parse(data.responseText);
    var selectBox = document.getElementById('destination');

    for (var i = 0; i < data.length; i++) {
      displayLocation(data[i]);
      addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
    }
  });
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function hideMarkers() {
  console.log("gmarkers.length=" + gmarkers.length);
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function addOption(selectBox, text, value) {
  var option = document.createElement("OPTION");
  option.text = text;
  option.value = value;
  selectBox.options.add(option);
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  console.log("selected option value=" + destination);
  console.log(" value=" + hakim);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  console.log("origin:" + start);
  console.log("dest:" + destination.toUrlValue(12));
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();
    }
  });
  displayLocation(hakim);
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function makeRequest(url, callback) {
  var request;
  if (window.XMLHttpRequest) {
    request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
  } else {
    request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
  }
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      callback(request);
    }
  }
  request.open("GET", url, true);
  request.send();
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


function displayLocation(rythmstu_innotec) {
  var content = '<div class="infoWindow"><strong> Code Client : ' + rythmstu_innotec.CodeClient + '</strong>' +
    '<br />Latitude : ' + rythmstu_innotec.Latitude +
    '<br />Longitude : ' + rythmstu_innotec.Longitude +
    '<br />Route : ' + rythmstu_innotec.Route +
    '<br />Secteur : ' + rythmstu_innotec.Secteur +
    '<br />Agence : ' + rythmstu_innotec.Agence +
    '<br />prenom de Client : ' + rythmstu_innotec.PrenomClient +
    '<br />Num Adresse : ' + rythmstu_innotec.NumAdresse +
    '<br />GeoAdresse : ' + rythmstu_innotec.GeoAdresse +
    '<br />Téléphone : ' + rythmstu_innotec.Tel +
    '<br />Whatsapp : ' + rythmstu_innotec.Whatsapp +
    '<br />Nbr Frigos : ' + rythmstu_innotec.NbrFrigo +
    '<br />Ouverture Matin : ' + rythmstu_innotec.OpenAm +
    '<br />Fermeture Matin : ' + rythmstu_innotec.CloseAm +
    '<br />Ouverture après-midi : ' + rythmstu_innotec.OpenPm +
    '<br />Fermeture Après-midi : ' + rythmstu_innotec.ClosePm + '</div>';

  if (parseInt(rythmstu_innotec.Latitude) == 0) {
    geocoder.geocode({
      'GeoAdresse': rythmstu_innotec.GeoAdresse
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.rythmstu_innotec,
          title: rythmstu_innotec.name
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });
      }
    });
  } else {
    var position = new google.maps.LatLng(parseFloat(rythmstu_innotec.Latitude), parseFloat(rythmstu_innotec.Longitude));
    var marker = new google.maps.Marker({
      map: map,
      position: position,
      title: rythmstu_innotec.name
    });
    gmarkers.push(marker);

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(content);
      infowindow.open(map, marker);
    });
  }
}
body {
  font: normal 14px Verdana;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

#sidebar {
  float: right;
  width: 30%;
}

#main {
  padding-right: 15px;
}

.infoWindow {
  width: 220px;
}
<title>MAP itinéraire </title>
<meta charset="utf-8">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

<body onload="init();">

  <form id="services">
    Location: <input type="text" id="start" value="Midar" /> Destination:
    <select id="destination" onchange="calculateRoute();"></select>
    <input type="button" value="clear map" onclick="toggleMarkers();" />
  </form>

  <section id="sidebar">
    <div id="directions_panel"></div>
  </section>

  <section id="main">
    <div id="map_canvas" style="width: 70%; height: 750px;"></div>
  </section>

</body>
-----------------------
function hideMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();  // <========================= call it here
    }
  });
  displayLocation(hakim);
}
var gmarkers = [];

var map;
var directionsService;
var directionsDisplay;
var geocoder;
var infowindow;

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function init() {
  directionsService = new google.maps.DirectionsService();
  directionsDisplay = new google.maps.DirectionsRenderer();
  geocoder = new google.maps.Geocoder();
  infowindow = new google.maps.InfoWindow();

  /*++++++++++++++++++*/

  var mapOptions = {
    zoom: 6,
    center: center = new google.maps.LatLng(32, -6),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  /*++++++++++++++++++*/

  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  directionsDisplay.setMap(map);
  directionsDisplay.setPanel(document.getElementById('directions_panel'));

  // Detect user location
  if (navigator.geolocation) {

    navigator.geolocation.getCurrentPosition(function(position) {
      var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      geocoder.geocode({
        'latLng': userLocation
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          document.getElementById('start').value = results[0].formatted_address
        }
      });

    }, function() {
      alert('Geolocation is supported, but it failed');
    });
  }

  /*++++++++++++++++++*/

  makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    var data = JSON.parse(data.responseText);
    var selectBox = document.getElementById('destination');

    for (var i = 0; i < data.length; i++) {
      displayLocation(data[i]);
      addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
    }
  });
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function hideMarkers() {
  console.log("gmarkers.length=" + gmarkers.length);
  for (i = 0; i < gmarkers.length; i++) {
    gmarkers[i].setMap(null);
  }
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function addOption(selectBox, text, value) {
  var option = document.createElement("OPTION");
  option.text = text;
  option.value = value;
  selectBox.options.add(option);
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  console.log("selected option value=" + destination);
  console.log(" value=" + hakim);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  console.log("origin:" + start);
  console.log("dest:" + destination.toUrlValue(12));
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
      hideMarkers();
    }
  });
  displayLocation(hakim);
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function makeRequest(url, callback) {
  var request;
  if (window.XMLHttpRequest) {
    request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
  } else {
    request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
  }
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      callback(request);
    }
  }
  request.open("GET", url, true);
  request.send();
}

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


function displayLocation(rythmstu_innotec) {
  var content = '<div class="infoWindow"><strong> Code Client : ' + rythmstu_innotec.CodeClient + '</strong>' +
    '<br />Latitude : ' + rythmstu_innotec.Latitude +
    '<br />Longitude : ' + rythmstu_innotec.Longitude +
    '<br />Route : ' + rythmstu_innotec.Route +
    '<br />Secteur : ' + rythmstu_innotec.Secteur +
    '<br />Agence : ' + rythmstu_innotec.Agence +
    '<br />prenom de Client : ' + rythmstu_innotec.PrenomClient +
    '<br />Num Adresse : ' + rythmstu_innotec.NumAdresse +
    '<br />GeoAdresse : ' + rythmstu_innotec.GeoAdresse +
    '<br />Téléphone : ' + rythmstu_innotec.Tel +
    '<br />Whatsapp : ' + rythmstu_innotec.Whatsapp +
    '<br />Nbr Frigos : ' + rythmstu_innotec.NbrFrigo +
    '<br />Ouverture Matin : ' + rythmstu_innotec.OpenAm +
    '<br />Fermeture Matin : ' + rythmstu_innotec.CloseAm +
    '<br />Ouverture après-midi : ' + rythmstu_innotec.OpenPm +
    '<br />Fermeture Après-midi : ' + rythmstu_innotec.ClosePm + '</div>';

  if (parseInt(rythmstu_innotec.Latitude) == 0) {
    geocoder.geocode({
      'GeoAdresse': rythmstu_innotec.GeoAdresse
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.rythmstu_innotec,
          title: rythmstu_innotec.name
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });
      }
    });
  } else {
    var position = new google.maps.LatLng(parseFloat(rythmstu_innotec.Latitude), parseFloat(rythmstu_innotec.Longitude));
    var marker = new google.maps.Marker({
      map: map,
      position: position,
      title: rythmstu_innotec.name
    });
    gmarkers.push(marker);

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(content);
      infowindow.open(map, marker);
    });
  }
}
body {
  font: normal 14px Verdana;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

#sidebar {
  float: right;
  width: 30%;
}

#main {
  padding-right: 15px;
}

.infoWindow {
  width: 220px;
}
<title>MAP itinéraire </title>
<meta charset="utf-8">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

<body onload="init();">

  <form id="services">
    Location: <input type="text" id="start" value="Midar" /> Destination:
    <select id="destination" onchange="calculateRoute();"></select>
    <input type="button" value="clear map" onclick="toggleMarkers();" />
  </form>

  <section id="sidebar">
    <div id="directions_panel"></div>
  </section>

  <section id="main">
    <div id="map_canvas" style="width: 70%; height: 750px;"></div>
  </section>

</body>

OIDC reverse proxy sidecar in kubernetes

apiVersion: v1
kind: Service
metadata:
  name: oauth2-client-service-sidecar
spec:
  selector:
    app: OAuth2Client
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
proxy_pass  http://oauth2-client-service-sidecar.<namespacen>.cluster.local/OAuth2Client;
-----------------------
apiVersion: v1
kind: Service
metadata:
  name: oauth2-client-service-sidecar
spec:
  selector:
    app: OAuth2Client
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
proxy_pass  http://oauth2-client-service-sidecar.<namespacen>.cluster.local/OAuth2Client;

Spring Security 5.2 -- how to customize NimbusJWTDecoder used by OAuth2ResourceServer?

@Bean
public JwtDecoderFactory<ClientRegistration> customJwtDecoderFactory() {
    return new CustomJwtDecoderFactory();
}

static class CustomJwtDecoderFactory implements JwtDecoderFactory<ClientRegistration> {
    public JwtDecoder createDecoder(ClientRegistration reg) {
        //...

        return new CustomJwtDecoder();
    }
}

SignOut does not redirect to site home page

    services.AddAuthentication(...)
        .AddCookie("Cookies")
        .AddOpenIdConnect("oidc", options =>
        {
            ...
            options.Events.OnSignedOutCallbackRedirect += context =>
            {
                context.Response.Redirect(context.Options.SignedOutRedirectUri);
                context.HandleResponse();

                return Task.CompletedTask;
            };
            ...
        });

OpenAm how to redirect to template in callback (proceess method)

<ModuleProperties moduleName="MyAuth" version="1.0" >
    <Callbacks length="0" order="1" timeout="600" header="#NOT SHOWN#" template="readme.html"/>

    <Callbacks length="2" order="2" timeout="600" header="#TO BE SUBSTITUTED#">
        <NameCallback isRequired="true" >
            <Prompt>Username</Prompt>
        </NameCallback>
        <PasswordCallback echoPassword="false" >
            <Prompt>Password</Prompt>
        </PasswordCallback>
    </Callbacks>

    <Callbacks length="1 order="3" timeout="600" header="#TO BE SUBSTITUTED#">
        <NameCallback isRequired="true" >
            <Prompt>Additional Input</Prompt>
        </NameCallback>
    </Callbacks>    
</ModuleProperties>
public class MyAuth extends AMLoginModule {
// same code here

     @Override
        public int process(Callback[] callbacks, int state) throws LoginException {

//same code logic here 

 switch (state) {
case AUTHENTICATE:

return GET_ADDITIONAL_DATA;
//...
case GET_ADDITIONAL_DATA:
  final String additionalData = ((NameCallback) callbacks[0]).getName();
  // handle additional data
}
}

} 
-----------------------
<ModuleProperties moduleName="MyAuth" version="1.0" >
    <Callbacks length="0" order="1" timeout="600" header="#NOT SHOWN#" template="readme.html"/>

    <Callbacks length="2" order="2" timeout="600" header="#TO BE SUBSTITUTED#">
        <NameCallback isRequired="true" >
            <Prompt>Username</Prompt>
        </NameCallback>
        <PasswordCallback echoPassword="false" >
            <Prompt>Password</Prompt>
        </PasswordCallback>
    </Callbacks>

    <Callbacks length="1 order="3" timeout="600" header="#TO BE SUBSTITUTED#">
        <NameCallback isRequired="true" >
            <Prompt>Additional Input</Prompt>
        </NameCallback>
    </Callbacks>    
</ModuleProperties>
public class MyAuth extends AMLoginModule {
// same code here

     @Override
        public int process(Callback[] callbacks, int state) throws LoginException {

//same code logic here 

 switch (state) {
case AUTHENTICATE:

return GET_ADDITIONAL_DATA;
//...
case GET_ADDITIONAL_DATA:
  final String additionalData = ((NameCallback) callbacks[0]).getName();
  // handle additional data
}
}

} 

OpenAM - Getting a Session attribute into an OpenID Connect claim

/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
*/
import com.iplanet.sso.SSOException
import com.sun.identity.idm.IdRepoException
import org.forgerock.oauth2.core.UserInfoClaims

/*
* Defined variables:
* logger - always presents, the "OAuth2Provider" debug logger instance
* claims - always present, default server provided claims
* session - present if the request contains the session cookie, the user's session object
* identity - always present, the identity of the resource owner
* scopes - always present, the requested scopes
* requestedClaims - Map<String, Set<String>>
*                  always present, not empty if the request contains a claims parameter and server has enabled
*                  claims_parameter_supported, map of requested claims to possible values, otherwise empty,
*                  requested claims with no requested values will have a key but no value in the map. A key with
*                  a single value in its Set indicates this is the only value that should be returned.
* Required to return a Map of claims to be added to the id_token claims
*
* Expected return value structure:
* UserInfoClaims {
*    Map<String, Object> values; // The values of the claims for the user information
*    Map<String, List<String>> compositeScopes; // Mapping of scope name to a list of claim names.
* }
*/

// user session not guaranteed to be present
boolean sessionPresent = session != null

def fromSet = { claim, attr ->
    if (attr != null && attr.size() == 1){
        attr.iterator().next()
    } else if (attr != null && attr.size() > 1){
        attr
    } else if (logger.warningEnabled()) {
        logger.warning("OpenAMScopeValidator.getUserInfo(): Got an empty result for claim=$claim");
    }
}

attributeRetriever = { attribute, claim, identity, session, requested ->
    if (requested == null || requested.isEmpty()) {
        fromSet(claim, identity.getAttribute(attribute))
    } else if (requested.size() == 1) {
        requested.iterator().next()
    } else {
        throw new RuntimeException("No selection logic for $claim defined. Values: $requested")
    }
}

sessionAttributeRetriever = { attribute, claim, identity, session, requested ->
    if (requested == null || requested.isEmpty()) {
        if (session != null) {
            fromSet(claim, session.getProperty(attribute))
        } else {
            null
        }
    } else if (requested.size() == 1) {
        requested.iterator().next()
    } else {
        throw new RuntimeException("No selection logic for $claim defined. Values: $requested")
    }
}

// [ {claim}: {attribute retriever}, ... ]
claimAttributes = [
        "email": attributeRetriever.curry("mail"),
        "address": { claim, identity, session, requested -> [ "formatted" : attributeRetriever("postaladdress", claim, identity, session, requested) ] },
        "phone_number": attributeRetriever.curry("telephonenumber"),
        "given_name": attributeRetriever.curry("givenname"),
        "zoneinfo": attributeRetriever.curry("preferredtimezone"),
        "family_name": attributeRetriever.curry("sn"),
        "locale": attributeRetriever.curry("preferredlocale"),
        "name": attributeRetriever.curry("cn"),
        "spid_uid": attributeRetriever.curry("employeeNumber"),
        "spid_idp": attributeRetriever.curry("idpEntityId"),
        "spid_gender": attributeRetriever.curry("description"),
        "spid_authType": sessionAttributeRetriever.curry("AuthType"),
        "spid_authLevel": sessionAttributeRetriever.curry("AuthLevel"),
]

// {scope}: [ {claim}, ... ]
scopeClaimsMap = [
        "email": [ "email" ],
        "address": [ "address" ],
        "phone": [ "phone_number" ],
        "profile": [ "given_name", "zoneinfo", "family_name", "locale", "name" ],
        "spid": [ "spid_uid", "spid_idp", "spid_authType", "spid_authLevel", "spid_gender" ],
]

if (logger.messageEnabled()) {
    scopes.findAll { s -> !("openid".equals(s) || scopeClaimsMap.containsKey(s)) }.each { s ->
        logger.message("OpenAMScopeValidator.getUserInfo()::Message: scope not bound to claims: $s")
    }
}

def computeClaim = { claim, requestedValues ->
    try {
        [ claim, claimAttributes.get(claim)(claim, identity, session, requestedValues) ]
    } catch (IdRepoException e) {
        if (logger.warningEnabled()) {
            logger.warning("OpenAMScopeValidator.getUserInfo(): Unable to retrieve attribute=$attribute", e);
        }
    } catch (SSOException e) {
        if (logger.warningEnabled()) {
            logger.warning("OpenAMScopeValidator.getUserInfo(): Unable to retrieve attribute=$attribute", e);
        }
    }
}

def computedClaims = scopes.findAll { s -> !"openid".equals(s) && scopeClaimsMap.containsKey(s) }.inject(claims) { map, s ->
    scopeClaims = scopeClaimsMap.get(s)
    map << scopeClaims.findAll { c -> !requestedClaims.containsKey(c) }.collectEntries([:]) { claim -> computeClaim(claim, null) }
}.findAll { map -> map.value != null } << requestedClaims.collectEntries([:]) { claim, requestedValue ->
    computeClaim(claim, requestedValue)
}

def compositeScopes = scopeClaimsMap.findAll { scope ->
    scopes.contains(scope.key)
}

return new UserInfoClaims((Map)computedClaims, (Map)compositeScopes)

Grafana Integration with Identity Provider using openid connect and generic oauth

scopes = openid email profile
auth_url = https://openam.example.com:8443/openam/oauth2/authorize
token_url = https://openam.example.com:8443/openam/oauth2/access_token
api_url = https://openam.example.com:8443/openam/oauth2/userinfo

CASE WHEN with COLLECT_SET

SELECT id, max(CASE WHEN productname='OpenDJ' THEN 1 ELSE 0 END) AS flag 
  FROM ds.forgerock
 GROUP BY id;

idRepo filesize slowly growing to large

com.iplanet.am.sdk.caching.enabled=false
com.sun.identity.sm.cache.enabled=true
com.sun.identity.idm.cache.enabled=false

Start Tomcat on reboot with different user

#!/bin/sh

# Purpose: Start or stop the Tomcat service.
# chkconfig: 345 95 5
# Check the path of Tomcat and set enviorment variables as follows in the .bashrc profile
export CATALINA_HOME="/path/tomcat"
export CATALINA_BASE="/path/tomcat"
JAVA_HOME="/usr/java/jdk1.8.0_131"
export JAVA_HOME

case $1 in
start)
su user -c /path/tomcat/bin/startup.sh
;;
stop)
su user -c /path/bin/shutdown.sh
;;
restart)
su user -c /path/tomcat/bin/shutdown.sh
su user -c /path/tomcat/bin/startup.sh
;;
esac
exit 0
chkconfig --add tomcat
-----------------------
#!/bin/sh

# Purpose: Start or stop the Tomcat service.
# chkconfig: 345 95 5
# Check the path of Tomcat and set enviorment variables as follows in the .bashrc profile
export CATALINA_HOME="/path/tomcat"
export CATALINA_BASE="/path/tomcat"
JAVA_HOME="/usr/java/jdk1.8.0_131"
export JAVA_HOME

case $1 in
start)
su user -c /path/tomcat/bin/startup.sh
;;
stop)
su user -c /path/bin/shutdown.sh
;;
restart)
su user -c /path/tomcat/bin/shutdown.sh
su user -c /path/tomcat/bin/startup.sh
;;
esac
exit 0
chkconfig --add tomcat

COMMUNITY DISCUSSIONS

Top Trending Discussions on OpenAM
  • How to make OpenAM to return jwt-token with simple username and password authentication
  • How to create a web policy agent in OpenAM given that the server URL has a not fully qualified hostname?
  • how to hide other markers after display direction on google map
  • OIDC reverse proxy sidecar in kubernetes
  • OpenAM auth chain that allows login for Administrative users only?
  • OpenAM - SAML, Auto federation and Self Service Password Reset
  • How To Configure openam SAML2 service provider to use NameID Format unspecified
  • Spring Security 5.2 -- how to customize NimbusJWTDecoder used by OAuth2ResourceServer?
  • Failed to get location header of ajax request?
  • Pingfederate kerberos authentication is authenticating any user from any domain
Top Trending Discussions on OpenAM

QUESTION

How to make OpenAM to return jwt-token with simple username and password authentication

Asked 2021-Feb-03 at 12:41

My problem is that I want to configure Openam so that it returns a JWT-token when I use The simplest user name / password authentication. By default, it returns tokenId. But in my case, I need only JWT-token. I am using this endpoint for authentication: http://openam-01.domain.com:8080/openam/json/authenticate.

Thx!

ANSWER

Answered 2021-Jan-31 at 16:51

OpenAM only issues a JWT when you are using 'stateless' / client based SSO session. If you need a standardised JWT, then you need to configure OpenAM as OIDC provider.

Source https://stackoverflow.com/questions/65973163

QUESTION

How to create a web policy agent in OpenAM given that the server URL has a not fully qualified hostname?

Asked 2020-Dec-18 at 12:08

Question: How to create a web policy agent in OpenAM given that the server URL, which OpenAM runs on, has a not fully qualified hostname?

Initial situation: For a Prove of concept (POC), I emulate a server structure using docker. I have an apache webserver as a resource server (docker container), an OpenAM docker container for the access management, and a flask web app running in a third container as the client. I configured OpenAM via the GUI. Sofar my flask app can authenticate, request, and retrieve access tokens using simple requests as specified here. However now I also want to protect the apache resource server. For the start without flask and simply by installing an OpenAM Web Policy Agent on the apache webserver and configuring a web policy agent profile in OpenAM following this official ForgeRock guide.

Problem: When configuring the agent profile in OpenAM using the GUI the OpenAM container's domain name http://openam:8080/openam is not accepted as a valid server URL.

host name error

If I use instead e.g. http://openam.local:8080/openam the error does not show.

What I tried so far:

  1. I added an Nginx container that functions as a reverse proxy and used it to change the container's hostnames to <container>.local. Now I can reach the containers e.g. via http://openam.local:8080/openam and http://apache.local:8080. However, when I now access the OpenAM GUI using http://openam.local:8080/openam, enter the default passwords, and press Create Configuration the configuration fails with the following message:creat config error
  2. Unable to solve the problem from (1) I figured that I recall the Nginx setup and instead try to configure the agent profile using the command line - in the hope that the above error Hostname of server URL is not fully qualified is restricted to the GUI. For the setup via the command line there existed the easy command ./ssoadm create-agent ... as descript here. But ssoadm was deprecated in favor of Amster and I am unable to figure out how to configure the agent policy using Amster.

ANSWER

Answered 2020-Dec-18 at 12:08

That's a bug in OpenAM console / service validation, it's tracked as OPENAM-16073

However these times there are some OpenAM forks. I would encourage those people to rename their product / project as it's quite confusing.

Source https://stackoverflow.com/questions/65344451

QUESTION

how to hide other markers after display direction on google map

Asked 2020-Apr-18 at 06:56

this google map is to get directions to a location specified by coordinates of the customer as the destination.

To get that from data in the select, i make it a google.maps.LatLng object, and i save the coordinates as a string in the value, then i parse out the latitude and longitude to create the LatLng object.

the steps is :

1-save the coordinates in the option value:

for (var i = 0; i < data.length; i++) {
  displayLocation(data[i]);
  addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
}

2-parse those coordinates and create a google.maps.LatLng object in the directions request:

function calculateRoute() {

  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  console.log("selected option value=" + destination);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }
  // ....

(all the above works fine)

-----This is where i am stuck:-----

Even the direction to a specified marker is displayed, the problem is that all markers still in the map, for me I try to make my function display just two things the direction and the marker with the code-client whom I choose, and all other markers will hide.

Here is my Notes about what i add in my code,

**1--***Once I added this function to push all markers in one variable*

    makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    for (var i = 0; i < data.length; i++) {

      var marker = new google.maps.Marker({
        position: new google.maps.LatLng(data[i].Latitude, data[i].Longitude),
        title: data[i].CodeClient,
        map: map
        });

        gmarkers.push(marker);
    }

  }); 

**2--***and i add this function to hide other markers*

 function toggleMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    if (gmarkers[i].getMap() != null) gmarkers[i].setMap(null);
    else gmarkers[i].setMap(map);
  }
}

This problem I have been facing for days and can't seem to resolve , even I've tried looking at a large variety of code blocks here and on the Google Maps API documentation but STILL have not been able to figure out how to hide other markers.

Any suggestions, ideas and help will much appreciated!

this is a screenshot :

enter image description here

----------------------------------------------------------------------------------------------------------------------------------

Here is my code after i updated it

after your advises ,this the update of my code .

it work good , after i click on the button (clear markers) all markers will remove.

Now i wanna know how to make the function toggleMarkers() , remove all markers but it will keep the marker with the code-client whom I choose,

var gmarkers = [];

var map;
var directionsService;
var directionsDisplay;
var geocoder;
var infowindow;

      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function init() {
  directionsService = new google.maps.DirectionsService();
  directionsDisplay = new google.maps.DirectionsRenderer();
  geocoder = new google.maps.Geocoder();
  infowindow = new google.maps.InfoWindow();
  
      /*++++++++++++++++++*/
      
  var mapOptions = {
    zoom: 6,
    center: center = new google.maps.LatLng(32, -6),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

        /*++++++++++++++++++*/

  map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  directionsDisplay.setMap(map);
  directionsDisplay.setPanel(document.getElementById('directions_panel'));

  // Detect user location
  if (navigator.geolocation) {
   
    navigator.geolocation.getCurrentPosition(function(position) {
      var userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      geocoder.geocode({
        'latLng': userLocation
      }, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          document.getElementById('start').value = results[0].formatted_address
        }
      });

    }, function() {
      alert('Geolocation is supported, but it failed');
    });
  }
  
      /*++++++++++++++++++*/

  makeRequest('https://gist.githubusercontent.com/abdelhakimsalama/3cce25789f00c1b84ccb5b231ec455b7/raw/393220f08a02b962e3e764d2b497b318353828db/gistfile1.txt', function(data) {

    var data = JSON.parse(data.responseText);
    var selectBox = document.getElementById('destination');

    for (var i = 0; i < data.length; i++) {
      displayLocation(data[i]);
      addOption(selectBox, data[i]['CodeClient'], data[i].Latitude + "," + data[i].Longitude);
    }

  }); 
  

}

      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function toggleMarkers() {
  for (i = 0; i < gmarkers.length; i++) {
    if (gmarkers[i].getMap() != null) gmarkers[i].setMap(null);
    else gmarkers[i].setMap(map);
  }
} 
      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function addOption(selectBox, text, value) {
  var option = document.createElement("OPTION");
  option.text = text;
  option.value = value;
  selectBox.options.add(option);
}

      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function calculateRoute() {
  var start = document.getElementById('start').value;
  var destination = document.getElementById('destination').value;
  var hakim = document.getElementById('destination');
  console.log("selected option value=" + destination);
  console.log(" value=" + hakim);
  var destPt = destination.split(",");
  var destination = new google.maps.LatLng(destPt[0], destPt[1]);
  if (start == '') {
    start = center;
  }

  var request = {
    origin: start,
    destination: destination,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
  console.log("origin:" + start);
  console.log("dest:" + destination.toUrlValue(12));
  directionsService.route(request, function(response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(response);
    }
  });
  alert("???");
  displayLocation(hakim);
}

      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

function makeRequest(url, callback) {
  var request;
  if (window.XMLHttpRequest) {
    request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
  } else {
    request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
  }
  request.onreadystatechange = function() {
    if (request.readyState == 4 && request.status == 200) {
      callback(request);
    }
  }
  request.open("GET", url, true);
  request.send();
}

      /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


function displayLocation(rythmstu_innotec) {
  var content = '<div class="infoWindow"><strong> Code Client : ' + rythmstu_innotec.CodeClient + '</strong>' +
    '<br />Latitude : ' + rythmstu_innotec.Latitude +
    '<br />Longitude : ' + rythmstu_innotec.Longitude +
    '<br />Route : ' + rythmstu_innotec.Route +
    '<br />Secteur : ' + rythmstu_innotec.Secteur +
    '<br />Agence : ' + rythmstu_innotec.Agence +
    '<br />prenom de Client : ' + rythmstu_innotec.PrenomClient +
    '<br />Num Adresse : ' + rythmstu_innotec.NumAdresse +
    '<br />GeoAdresse : ' + rythmstu_innotec.GeoAdresse +
    '<br />Téléphone : ' + rythmstu_innotec.Tel +
    '<br />Whatsapp : ' + rythmstu_innotec.Whatsapp +
    '<br />Nbr Frigos : ' + rythmstu_innotec.NbrFrigo +
    '<br />Ouverture Matin : ' + rythmstu_innotec.OpenAm +
    '<br />Fermeture Matin : ' + rythmstu_innotec.CloseAm +
    '<br />Ouverture après-midi : ' + rythmstu_innotec.OpenPm +
    '<br />Fermeture Après-midi : ' + rythmstu_innotec.ClosePm + '</div>';

  if (parseInt(rythmstu_innotec.Latitude) == 0) {
    geocoder.geocode({
      'GeoAdresse': rythmstu_innotec.GeoAdresse
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.rythmstu_innotec,
          title: rythmstu_innotec.name
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(content);
          infowindow.open(map, marker);
        });
      }
    });
  } else {
    var position = new google.maps.LatLng(parseFloat(rythmstu_innotec.Latitude), parseFloat(rythmstu_innotec.Longitude));
    var marker = new google.maps.Marker({
      map: map,
      position: position,
      title: rythmstu_innotec.name
    });
 gmarkers.push(marker);

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(content);
      infowindow.open(map, marker);
    });
  }
}
body {
  font: normal 14px Verdana;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

#sidebar {
  float: right;
  width: 30%;
}

#main {
  padding-right: 15px;
}

.infoWindow {
  width: 220px;
}
<title>MAP itinéraire </title>
<meta charset="utf-8">
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>

<body onload="init();">



  <form id="services">
    Location: <input type="text" id="start" value="Midar" /> Destination:
    <select id="destination" onchange="calculateRoute();"></select>
    <input type="button" value="clear map" onclick="toggleMarkers();" />
  </form>

  <section id="sidebar">
    <div id="directions_panel"></div>
  </section>

  <section id="main">
    <div id="map_canvas" style="width: 70%; height: 750px;"></div>
  </section>

</body>

ANSWER

Answered 2018-Jun-11 at 04:04

You do not need to use var marker = new google.maps.Marker for the Directions API. They are automatically added there and will also automatically disappear once you request for a new route.

Here is a sample app that renders the directions once the dropdown menu is changed. You can see the Javascript codes that it does not have anything that calls the marker or infowindow object, but they are both present in the map. The marker is automatically added on the origin and destination point. And if you click on those markers, the infowindow automatically appears!

function initMap() {
   var directionsService = new google.maps.DirectionsService();
   var chicago = new google.maps.LatLng(41.85, -87.65);
   var directionsDisplay = new google.maps.DirectionsRenderer();
   var map = new google.maps.Map(document.getElementById('distance-map'), {
      zoom: 5.2,
      center: chicago
   });
   directionsDisplay.setMap(map);

   var onChangeHandler = function() {
      calculateAndDisplayRoute(directionsService, directionsDisplay);
   };
   document.getElementById('start').addEventListener('change', onChangeHandler);
   document.getElementById('end').addEventListener('change', onChangeHandler);
}

function calculateAndDisplayRoute(directionsService, directionsDisplay) {
   directionsService.route({
      origin: document.getElementById('start').value,
      destination: document.getElementById('end').value,
      travelMode: 'DRIVING'
   }, function(response, status) {
      if (status === 'OK') {
         directionsDisplay.setDirections(response);
      } else {
         window.alert('Directions request failed due to ' + status);
      }
   });
}
#distance-map {
  height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#floating-panel {
  position: absolute;
  top: 10px;
  left: 25%;
  z-index: 5;
  background-color: #fff;
  padding: 5px;
  border: 1px solid #999;
  text-align: center;
  font-family: 'Roboto','sans-serif';
  line-height: 30px;
  padding-left: 10px;
}
#warnings-panel {
  width: 100%;
  height:10%;
  text-align: center;
}
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>JS Bin</title>
   </head>
   <body>
   <br />
      <div id="distance-panel">
         Start:
         <select id="start">
            <option value='41.878114,-87.629798'>Chicago</option>
            <option value='42.331427,-83.045754'>Detroit</option>
            <option value='39.099727,-94.578567'>Kansas City</option>
            <option value='41.600545,-93.609106'>Des Molines</option>
         </select>
         End:
         <select id="end">
            <option value='38.833882,-104.821363'>Colorado Springs</option>
            <option value='36.162664,-86.781602'>Nashville</option>
            <option value='39.768403,-86.158068'>Indianapolis</option>
            <option value='36.162664,-86.781602'>Nashville</option>
         </select>
      </div>
      <br />
      <div id="distance-map"></div>
      <script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLHKWYAEE2PDjvt6BaBH1SIs4Q93PMpQs&callback=initMap">
</script>
   </body>
</html>

You may also check the jsbin version here.

Hope this answered your question.

Source https://stackoverflow.com/questions/50789561

QUESTION

OIDC reverse proxy sidecar in kubernetes

Asked 2020-Mar-30 at 12:23

I'm trying to secure java applications on kubernetes.

For a simple Springboot app with permitAll, I choose openresty (nginx) with lua-resty-openidc as reverse proxy.

One example that illustrates mostly what I'm trying to do : https://medium.com/@lukas.eichler/securing-pods-with-sidecar-proxies-d84f8d34be3e

It "works" in localhost, but not on kubernetes.

Here's my nginx.conf :

worker_processes  1;

error_log  logs/error.log;
error_log  logs/error.log  notice;
error_log  logs/error.log  debug;

events {
    worker_connections  1024;
}

http {
    lua_package_path '~/lua/?.lua;;';

    resolver ${dns.ip};

    lua_ssl_trusted_certificate /ssl/certs/chain.pem;
    lua_ssl_verify_depth 5;

    lua_shared_dict discovery 1m;
    lua_shared_dict jwks 1m;
    lua_shared_dict introspection 10m;

    lua_shared_dict sessions 10m;

    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {
        server_name  localhost;
        listen       80;

        location /OAuth2Client {
            access_by_lua_block {
                local opts = {
                    discovery = "${openam-provider}/.well-known/openid-configuration",
                    redirect_uri = "http://localhost:8080/OAuth2Client/authorization-code/callback",
                    client_id = "myClientId",
                    client_secret = "myClientSecret",
                    scope = "openid profile email",
                }

                local res, err = require("resty.openidc").authenticate(opts)

                if err then
                    ngx.status = 500
                    ngx.say(err)
                    ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
                end

                ngx.req.set_header("Authorization", "Bearer " .. res.access_token)
                ngx.req.set_header("X-USER", res.id_token.sub)
            }

            proxy_pass  http://localhost:8080/OAuth2Client;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

So in local, as my nginx and my springboot app are running on localhost, the redirections are working.

Now, when I deploy it on kubernetes with this, the browser doesn't map localhost with the internal container ip.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: oauth2-client-deployment
spec:
  selector:
    matchLabels:
      app: OAuth2Client
  replicas: 2
  template:
    metadata:
      labels:
        app: OAuth2Client
    spec:
      #hostAliases:
      #- ip: "127.0.0.1"
      #  hostnames:
      #  - "oauth2-client.local"
      containers:
      - name: oauth2-client-container
        image: repo/oauth2-client-springboot:latest
        env:
          - name: SPRING_PROFILES_ACTIVE
            value: dev
        envFrom:
          - secretRef: 
              name: openam-client-secret
          - secretRef: 
              name: keystore-java-opts
        volumeMounts:
          - name: oauth2-client-keystore
            mountPath: "/projected"
            readOnly: true
        ports:
          - containerPort: 8080
      - name: oauth2-sidecar
        image: repo/oauth2-sidecar:latest
        ports:
          - containerPort: 80
      volumes:
        - name: oauth2-client-keystore
          projected:
            sources:
              - secret:
                   name: keystore-secret
                   items:
                    - key: keystore.jks
                      path: keystore.jks
              - secret:
                   name: truststore-secret
                   items:
                    - key: truststore.jks
                      path: truststore.jks
      imagePullSecrets:
      - name: regcred

---

apiVersion: v1
kind: Service
metadata:
  name: oauth2-client-service-sidecar
spec:
  selector:
    app: OAuth2Client
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: LoadBalancer

So how could I map this localhost ? I don't want the app container to be exposed as there's no security on it, that's why I used the nginx as sidecar and the service only targets it. How to tell nginx to redirect_uri and proxypass to the app container ip ?

And subsidiary question : as nginx doesn't accept env variables, how should I do to make it generic, so apps could provide their own redirect_uri that should be used in nginx.conf ?

Another subsidiary question : the command ngx.req.set_header("Authorization", "Bearer " .. res.access_token) doesn't seem to work, as I don't see any Authorization header in my request in my app...

ANSWER

Answered 2020-Mar-30 at 12:23

Configure your service with type ClusterIP to be reachable only internally, then use the fqdn in your services to reach the service without IP dependency.

apiVersion: v1
kind: Service
metadata:
  name: oauth2-client-service-sidecar
spec:
  selector:
    app: OAuth2Client
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP

Then use oauth2-client-service-sidecar.<namespacen>.cluster.local in your nginx configuration to reach the service:

proxy_pass  http://oauth2-client-service-sidecar.<namespacen>.cluster.local/OAuth2Client;

Source https://stackoverflow.com/questions/60810325

QUESTION

OpenAM auth chain that allows login for Administrative users only?

Asked 2020-Mar-03 at 07:08

Scenario:

I have an OpenAM instance with only the default realm configured. I have set up my Organization Auth Chain with a single LDAP module that allows my users to self register.

I also have set up another chain, called adminChain and set as the Administrator Auth Chain, with a single Data Store module in order to allow the amAdmin user to login using the /console url.

Problem:

My problem is that this second chain allows also non-admin users from the LDAP data store to login, which actually makes sense because it's using the DataStore module. But then how can I prevent normal users logging in with the admin chain? I want them to be limited to a specific chain only.

ANSWER

Answered 2020-Mar-03 at 07:08

You should use the root realm for administration and sub-realm for operations.

In fact OpenAM will use all configured user data stores in a realm when it's configured to support the requested operation.

As a workaround you could set the value of Authentication Naming Attribute in the user data store config to an attribute which does not exist in the entries. This will make 'datastore' authentication for regular users fail. AmAdmin can still authenticate because this identity is stored in a special data store which does not show up in OpenAM configuration.

Be aware that you may be subject of a bug, as in older versions the DN-Cache is leveraged during authentication.

Source https://stackoverflow.com/questions/60480373

QUESTION

OpenAM - SAML, Auto federation and Self Service Password Reset

Asked 2020-Mar-01 at 21:28

I need some brainstorming here, because I think that maybe I'm misunderstanding the whole SAML Federation point.

Some details about the context:

  • OpenAM hosting a SAML SP;
  • In the Circle of Trust I added https://samltest.id as a test IdP;
  • OpenAM is configured to dynamically create local users, because the admin must be able to set some attributes on federated users, let's say Dashboard entries or group memberships;
  • I have enabled AutoFederation and setup the user attribute mapping.

The federation is working fine - IdP users are correctly logged in and mapped to an existing, or just created, Data Store user. When a remote user is created on the Data Store, OpenAM assigns a random password that the user doesn't know, so the remote users can only login via the IdP.

Now, all users, including the remote ones, can access the console and set their own password. To prevent this, I set userPassword as a protected attribute, so if users don't know their current password they can't change it.

However I have noticed that users can request a Password Reset for accounts provisioned via the federation mechanism - this means that they can change the password for their account, and then login via the local login mechanism.

Am I missing something? Is this behavior expected when authenticating remote users? How do I set up everything in a way that allows me to keep local users separated from the remote ones?

ANSWER

Answered 2020-Mar-01 at 21:28

I think I solved this. I have modified the Organization Auth Configuration to use a new chain containing a LDAP module instead of the default ldapService that uses the DataStore module. I am able to distinguish between federated and local users by checking for a specific attribute on the LDAP store, so I modified the LDAP module to apply a User Search Filter excluding the federated users and now they no longer can authenticate locally using the recovery password workaround.

Source https://stackoverflow.com/questions/60460253

QUESTION

How To Configure openam SAML2 service provider to use NameID Format unspecified

Asked 2020-Feb-14 at 16:38

currently, we use openAM version 13.0.0 as a service provider for SAML2 SSO.

How To Configure openAM SAML2 service provider to use NameID Format unspecified?

Edit : I faced the following issue :

ERROR: spAssertionConsumer.jsp: SSO failed. com.sun.identity.saml2.common.SAML2Exception: No local user being mapped. at com.sun.identity.saml2.profile.SPACSUtils.processResponse(SPACSUtils.java:1225)

ANSWER

Answered 2020-Feb-14 at 07:54

Given you use spSSOInit.jsp to trigger SP-initiated SSO flow, you can specify the NameID format to be sent (NameIDPolicy element in SAML AuthNRequest) by using request parameter NameIDFormat. If it's supported by the SP and IdP, it will be used. If you do not specify this request parameter, OpenAM tries to find the first NameID format that is supported by both entities. If the IDP does not specify anything, the first NameID format of the hosted SP is used.

Source https://stackoverflow.com/questions/60213806

QUESTION

Spring Security 5.2 -- how to customize NimbusJWTDecoder used by OAuth2ResourceServer?

Asked 2020-Jan-15 at 17:04

i have an openid provider (openam) running locally. I am using a self-signed certificate and the jwks url is @ https://localhost:8443/openam/oauth2/connect/

Due to the ssl certificate being self signed, i am getting a SSLHandshake exception, when the oidc token is decoded. i tried using a custom rest template, by creating a custom JwtDecoder (as suggested in https://docs.spring.io/spring-security/site/docs/current/reference/html5/#oauth2resourceserver-jwt-decoder-dsl )

@Bean
public JwtDecoder jwtDecoder() {
NimbusJwtDecoder.withJwkSetUri("https://localhost:8443/openam/oauth2/connect").restOperations(myCustomRestTemplateThatAllowsSelfSignedCerts()).build();
}

But this decoder does not seem to be used. The OidcIdTokenDecoderFactory is being used to create the decoder. This class does not seem to allow us to pass in a custom jwtDecoder..

Why does the oauthResourceServer().jwt().decoder(customDecoder()) not work? How can i get the decoder to work with a jwks uri that is a website with a self signed certificate?

One option i am thinking of is to add the self-signed certificate to the cacerts folder of my jdk..

ANSWER

Answered 2020-Jan-15 at 17:04

OAuth2LoginAuthenticationFilter is calling OidcAuthorizationCodeAuthenticationProvider for OpenID authentication. To change the JwtDecoder that it uses, you should have a JwtDecoderFactory bean.

For example, you might have something like:

@Bean
public JwtDecoderFactory<ClientRegistration> customJwtDecoderFactory() {
    return new CustomJwtDecoderFactory();
}

static class CustomJwtDecoderFactory implements JwtDecoderFactory<ClientRegistration> {
    public JwtDecoder createDecoder(ClientRegistration reg) {
        //...

        return new CustomJwtDecoder();
    }
}

Hopefully this answers at least part of your question.

Source https://stackoverflow.com/questions/59744791

QUESTION

Failed to get location header of ajax request?

Asked 2020-Jan-08 at 13:40

I'm trying to access location header of the following ajax response. But it gives me null. My javascript code is,

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open("POST", "http://localhost:8080/openam/oauth2/authorize", true);
    xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    xmlhttp.setRequestHeader("Cache-Control", "no-cache");
    xmlhttp.withCredentials = true;

    xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
            if(this.readyState == this.HEADERS_RECEIVED) {
                alert(xmlhttp.getResponseHeader("Location"));
         }
    }

    xmlhttp.send(params);

Following are my corrosponding options and post requests,

Option Request

OPTIONS /openam/oauth2/authorize HTTP/1.1
Host: localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: cache-control
Origin: http://127.0.0.1:4000
Connection: keep-alive

Option Response

HTTP/1.1 200 
Access-Control-Allow-Origin: http://127.0.0.1:4000
access-control-allow-credentials: true
Access-Control-Max-Age: 10
Access-Control-Allow-Methods: POST

Access-Control-Allow-Headers: iplanetdirectorypro,cookie,origin,x-requested-with,access-control-request-headers,x-openam-password,content-type,location,x-openam-username,access-control-request-method,cache-control,accept

Content-Length: 0
Date: Mon, 20 Feb 2017 17:57:34 GMT

Post Request

POST /openam/oauth2/authorize HTTP/1.1  
Host: localhost:8080 
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cache-Control: no-cache 
Referer: http://127.0.0.1:4000/login.htm 
Content-Length: 139
Origin: http://127.0.0.1:4000
Cookie: amlbcookie=01; 

Post response

HTTP/1.1 302 
Access-Control-Allow-Origin: http://127.0.0.1:4000
access-control-allow-credentials: true
access-control-expose-headers: Access-Control-Allow-Origin,Access-Control-Allow-Credentials,Set-Cookie,Date,Location
Cache-Control: no-store
Date: Mon, 20 Feb 2017 17:57:34 GMT
Accept-Ranges: bytes
Location: http://localhost:8080?code=669b8303-d8cd-4e01-90ad-7cb89007fc65&scope=address%20openid%20profile%20email

Access-Control-Allow-Headers & Access-Control-Expose-Headers are available with proper Location value. But why can't i access Location header?

ANSWER

Answered 2017-Feb-20 at 18:18

You can't get the Location header because the browser will transparently follow it, so the response that XHR ends up processing is the next one (which won't have a Location header).

Source https://stackoverflow.com/questions/42351491

QUESTION

Pingfederate kerberos authentication is authenticating any user from any domain

Asked 2019-Dec-02 at 09:47

I am trying to configured SAML SSO with OpenAM as SP and PingFederate as IDP with SP-Initiated SSO and using Redirect-Post binding. I am using kerberos adapter for implementing SSO.

I have configured Kerberos adapter to use "e-glue.com" domain and provided KDC details in the configuration. I have also added "setspn" of Pingfederate server in domain controller properly. However when I login to a computer with valid "e-glue.com" user and hit SSO url with "https://hostname.e-glue.com:1912/openam/saml2/jsp/spSSOInit.jsp?idpEntityID=ent-026330&metaAlias=/sp" it redirects me to IDP and SSO is successful and user gets created in openam. But if I do the same thing with other domain.. which is not "e-glue.com", it still autheticates the user and user is created in openam.

This is so strange, there is something missing as the user which is not part of e-glue domain though we configured kerberos adapter to use e-glue.com KDC, is getting authenticated. I am missing something, not sure what. Please share if you have any information about what is going wrong.

ANSWER

Answered 2019-Dec-02 at 09:47

It happened because of inter-domain trust relationship.

PingFederate (IDP) is configured to authenticate users via "e-glue.com" domain.

So I logged in to my computer which was in domain "someother.domain". But this "someother.domain" implemented an Active Directory directory service forest and has trust relationship between "e-glue.com" and itself. So all users logged in to IDP are also VALID users because of trust relationship. It took me some time to understand this.

Source https://stackoverflow.com/questions/57994514

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

VULNERABILITIES

OpenAM (Open Source Edition) 13.0 and later does not properly manage sessions, which allows remote authenticated attackers to change the security questions and reset the login password via unspecified vectors.
Open redirect vulnerability in OpenAM (Open Source Edition) 13.0 allows remote attackers to redirect users to arbitrary web sites and conduct phishing attacks via a specially crafted page.
OpenAM (Open Source Edition) allows an attacker to bypass authentication and access unauthorized contents via unspecified vectors. Note that this vulnerability affects OpenAM (Open Source Edition) implementations configured as SAML 2.0IdP, and switches authentication methods based on AuthnContext requests sent from the service provider.

INSTALL OpenAM

You can use OpenAM like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the OpenAM component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

SUPPORT

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

Implement OpenAM faster with kandi.

  • Use the support, quality, security, license, reuse scores and reviewed functions to confirm the fit for your project.
  • Use the, Q & A, Installation and Support guides to implement faster.

Discover Millions of Libraries and
Pre-built Use Cases on kandi