<?php
session_start();

$appid = "29c796b1-ce4a-486f-8c33-578913c360a5";
$tennantid = "common";
$secret = "bbdef1d6-4993-4430-bcd5-e3061755a56e";

// nueva app con restriccions SKCAppInicioSession1 16-01-2024
$appid = "f1809540-3ac7-4018-bfa3-8d20b1adf8a9";
$tennantid = "049f1d45-bc1e-473d-baf9-7630814546b0";
$secret = "6bb9fbcb-6ef9-4ad0-93a9-7f84280da8a3";
//
$login_url = "https://login.microsoftonline.com/". $tennantid ."/oauth2/v2.0/authorize";

$params = array (
	'client_id' => $appid,
	'redirect_uri' => 'https://ssoqa.skc.cl',
	'response_type' => 'token',
	'response_mode' => 'form_post',
	'scope' => 'https://graph.microsoft.com/User.Read',
	'state' => $_SESSION['state']
);

header ('Location: '.$login_url.'?'.http_build_query ($params));
?>
