### Authorization endpoint URL example Source: https://www.geteduroam.app/developer/api Example URL for the authorization endpoint with required GET parameters: response_type=code, code_challenge_method=S256, scope, code_challenge, redirect_uri, client_id, and state. Used to initiate the OAuth2 authorization flow. ```http https://demo.eduroam.no/authorize.php?response_type=code&code_challenge_method=S256&scope=eap-metadata&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&redirect_uri=http%3A%2F%2Flocalhost%3A1080%2Fcallback&client_id=00000000-0000-0000-0000-000000000000&state=0 ``` -------------------------------- ### GET [authorization_endpoint] Source: https://www.geteduroam.app/developer/api Builds the authorization URL to authenticate the user and obtain an authorization code. The user is redirected to this URL in a local browser, and the server redirects back to the redirect_uri with a code or error. ```APIDOC ## [GET] [authorization_endpoint] ### Description Builds the authorization URL to authenticate the user and obtain an authorization code. The user is redirected to this URL in a local browser, and the server redirects back to the redirect_uri with a code or error. ### Method GET ### Endpoint [authorization_endpoint] (from discovery) ### Parameters #### Query Parameters - **response_type** (string) - Required - Set to `code` - **code_challenge_method** (string) - Required - Set to `S256` - **scope** (string) - Required - Choose between `eap-metadata` and `mobileconfig` - **code_challenge** (string) - Required - A code challenge as documented in RFC7636 section 4 - **redirect_uri** (string) - Required - Where the user should be redirected after accepting or rejecting your application; GET parameters will be added to this URL by the server - **client_id** (string) - Required - Your client ID as known by the server - **state** (string) - Required - A random string that will be set in a GET parameter to the redirect_uri for you to verify it's the same flow ### Request Example ``` https://demo.eduroam.no/authorize.php?response_type=code&code_challenge_method=S256&scope=eap-metadata&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&redirect_uri=http%3A%2F%2Flocalhost%3A1080%2Fcallback&client_id=00000000-0000-0000-0000-000000000000&state=0 ``` ### Response #### Success Response (200) Redirects to the redirect_uri with the following GET parameters: - **code** (string) - A code that you can use on the token endpoint - **state** (string) - The same value as your earlier state GET parameter #### Error Response Redirects to the redirect_uri with the following GET parameters: - **error** (string) - An error message that you can present to the user - **state** (string) - The same value as your earlier state GET parameter ``` -------------------------------- ### Token endpoint HTTP conversation Source: https://www.geteduroam.app/developer/api Example HTTP POST to the token endpoint with grant_type=authorization_code, code, redirect_uri, client_id, and code_verifier. The response is a JSON object containing access_token, token_type, and expires_in. ```http POST /token.php HTTP/1.1 Accept: application/json Content-Type: application/x-www-form-urlencoded Content-Length: 209 grant_type=authorization_code&code=v2.local.AAAAAA&redirect_uri=http%3A%2F%2Flocalhost%3A1080%2Fcallback&client_id=00000000-0000-0000-0000-000000000000&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk HTTP/1.1 200 OK Cache-Control: no-store Content-Type: application/json;charset=UTF-8 Pragma: no-cache { "access_token": "v2.local.AAAAA…==", "token_type": "Bearer", "expires_in": 3600 } ``` -------------------------------- ### Generator endpoint HTTP conversation Source: https://www.geteduroam.app/developer/api Example HTTP POST to the generator endpoint with format=eap-metadata and Authorization: Bearer. The response is an XML file attachment with Content-Disposition filename="johndoe.xml". ```http POST /generate.php? HTTP/1.1 Accept: application/x-eap-config Authorization: Bearer AAAAAA…== Content-Type: application/x-www-form-urlencoded Content-Length: 19 format=eap-metadata HTTP/1.1 200 OK Cache-Control: no-store Content-Disposition: attachment; filename="johndoe.xml" Content-Type: application/eap-config Pragma: no-cache … ``` -------------------------------- ### POST [generator_endpoint] Source: https://www.geteduroam.app/developer/api Downloads a client certificate profile in the requested format. Requires an access token as bearer and a format parameter. ```APIDOC ## [POST] [generator_endpoint] ### Description Downloads a client certificate profile in the requested format. Requires an access token as bearer and a format parameter. ### Method POST ### Endpoint [generator_endpoint] (from discovery) ### Parameters #### Request Body (application/x-www-form-urlencoded) - **format** (string) - Required - The profile format, e.g., `eap-metadata` (other formats may be supported) ### Request Example ``` POST /generate.php? HTTP/1.1 Accept: application/x-eap-config Authorization: Bearer AAAAAA…== Content-Type: application/x-www-form-urlencoded Content-Length: 19 format=eap-metadata ``` ### Response #### Success Response (200) - **body** (file) - The profile file, e.g., XML for eap-metadata #### Response Example ``` HTTP/1.1 200 OK Cache-Control: no-store Content-Disposition: attachment; filename="johndoe.xml" Content-Type: application/eap-config Pragma: no-cache … ``` ``` -------------------------------- ### POST [token_endpoint] Source: https://www.geteduroam.app/developer/api Exchanges the authorization code for an access token. Requires the code obtained from the authorization endpoint and a code verifier as per RFC7636. ```APIDOC ## [POST] [token_endpoint] ### Description Exchanges the authorization code for an access token. Requires the code obtained from the authorization endpoint and a code verifier as per RFC7636. ### Method POST ### Endpoint [token_endpoint] (from discovery) ### Parameters #### Request Body (application/x-www-form-urlencoded) - **grant_type** (string) - Required - Set to `authorization_code` - **code** (string) - Required - The code received from the authorization endpoint - **redirect_uri** (string) - Required - Repeat the value used in the previous request, as mandated by RFC7636 - **client_id** (string) - Required - Repeat the value used in the previous request, as mandated by RFC7636 - **code_verifier** (string) - Required - A code verifier as documented in RFC7636 section 4 ### Request Example ``` POST /token.php HTTP/1.1 Accept: application/json Content-Type: application/x-www-form-urlencoded Content-Length: 209 grant_type=authorization_code&code=v2.local.AAAAAA&redirect_uri=http%3A%2F%2Flocalhost%3A1080%2Fcallback&client_id=00000000-0000-0000-0000-000000000000&code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk ``` ### Response #### Success Response (200) - **access_token** (string) - The access token to be used as bearer token - **token_type** (string) - Set to `Bearer` - **expires_in** (integer) - Validity of the access_token in seconds #### Response Example ``` HTTP/1.1 200 OK Cache-Control: no-store Content-Type: application/json;charset=UTF-8 Pragma: no-cache { "access_token": "v2.local.AAAAA…==", "token_type": "Bearer", "expires_in": 3600 } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.