Authorize user apps with and without PKCE - Fabric

Authorize user app with and without PKCE

cURL

curl --request GET \
  --url https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize
import requests

url = "https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [\
  CURLOPT_URL => "https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize",\
  CURLOPT_RETURNTRANSFER => true,\
  CURLOPT_ENCODING => "",\
  CURLOPT_MAXREDIRS => 10,\
  CURLOPT_TIMEOUT => 30,\
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
  CURLOPT_CUSTOMREQUEST => "GET",\
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {

url := "https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://yourcompany.login.fabric.inc/oauth2/default/v1/authorize")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

Query Parameters

Response

302
Found. A successful response to this endpoint will re-direct the user to the hosted Login page provided by the fabric Identity. Once the user successfully logs in, fabric Identity would re-direct the client back to the redirect_uri hosted on the user app with the authorization code (as query parameter code) and the state (as query parameter state). The state parameter in the callback would be the same value as sent in the request.