"how to get access token using refresh token oauth2 graph api" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "how to get access token using refresh token oauth2 graph api" answered properly. Developers are finding an appropriate answer about how to get access token using refresh token oauth2 graph api related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like how to get access token using refresh token oauth2 graph api. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on how to get access token using refresh token oauth2 graph api.
how to get access token using refresh token oauth2 graph api
# SCRIPT BEGINS FROM HERE #
echo "SCRIPT EXECUTION BEGINS"
echo " "
echo "Script to request new access token and refresh token from refresh token of MS-Graph apis"
echo " "
echo "You can also follow this links for reference"
echo "https://www.youtube.com/watch?v=FTULjLL-ZDI"
echo "https://dzone.com/articles/getting-access-token-for-microsoft-graph-using-oau-1"
echo " "
echo "If don't know your Azure-AD-Tenant-Name then just follow this below link to get it"
echo "https://helpdesk.kaseya.com/hc/en-gb/articles/115002521251-How-Do-I-Find-My-Azure-AD-Tenant-Name-"
echo " "
read -p "Enter your Tenant name : " tenant
echo "Tenant named your entered is: $tenant "
echo " "
read -p "Enter your client_id: " client_id
echo "Client_id you entered is: $client_id"
echo " "
read -p "Enter your client_secret: " client_secret
echo "Client_secret you entered is: $client_secret"
echo " "
read -p "Enter your redirect_uri (eg. http://localhost): " redirect_uri
echo "redirect_uri you entered is: $redirect_uri"
echo " "
echo "Enter the refresh_token value you haved copied from postman"
read -p "Enter your refresh token: " refresh_token
echo " "
echo "Refresh_token: " $refresh_token
authorization_endpoint=$(curl -s "https://login.microsoftonline.com/${tenant}/v2.0/.well-known/openid-configuration" | jq -r '.authorization_endpoint')
token_endpoint=$(curl -s "https://login.microsoftonline.com/${tenant}/v2.0/.well-known/openid-configuration" | jq -r '.token_endpoint')
echo " "
echo "Authorize endpoint of your tenant is"
echo "$authorization_endpoint"
echo " "
echo "Token endpoint of your tenant is"
echo "$token_endpoint"
#token=$(curl -H "Content-Type: application/application/x-www-form-urlencoded" -X POST "https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" --data-urlencode 'client_id=63bf591a-e1c' --data-urlencode 'client_secret=WUR-AH-7ML1fSHT_oH6HVVA8Jd' --data-urlencode 'redirect_uri=http://localhost' --data-urlencode 'grant_type=refresh_token' --data-urlencode 'refresh_token=$refresh_token' --data-urlencode 'scope=https://graph.microsoft.com/.default' --data-urlencode 'tenant=$tenant' )
#token=$(curl -s -X POST "$token_endpoint" --header "Content-Type: application/x-www-form-urlencoded" --data-urlencode "client_id=45789-87a3-cbb1d1076b3b" --data-urlencode "client_secret=_oH6HVVA8Jd5p9OCa-S" --data-urlencode "redirect_uri=http://localhost" --data-urlencode "grant_type=refresh_token" --data-urlencode "refresh_token=$refresh_token" --data-urlencode "scope=openid profile offline_access https://graph.microsoft.com" --data-urlencode "tenant=$tenant" | jq .access_token)
token=$(curl -s -X POST "$token_endpoint" --header "Content-Type: application/x-www-form-urlencoded" --data-urlencode "client_id=$client_id" --data-urlencode "client_secret=$client_secret" --data-urlencode "redirect_uri=$redirect_uri" --data-urlencode "grant_type=refresh_token" --data-urlencode "refresh_token=$refresh_token" --data-urlencode "scope=openid profile offline_access https://graph.microsoft.com/.default" --data-urlencode "tenant=$tenant" | jq .access_token)
echo " "
echo "Your renewed access token is:"
echo " "
echo "$token"
echo " "
echo "SCRIPT ENDS"
# SCRIPT ENDS HERE
Source: stackoverflow.com
All those coders who are working on the Whatever based application and are stuck on how to get access token using refresh token oauth2 graph api can get a collection of related answers to their query. Programmers need to enter their query on how to get access token using refresh token oauth2 graph api related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about how to get access token using refresh token oauth2 graph api for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of how to get access token using refresh token oauth2 graph api while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "how to get access token using refresh token oauth2 graph api". Visit this developer's friendly online web community, CodeProZone, and get your queries like how to get access token using refresh token oauth2 graph api resolved professionally and stay updated to the latest Whatever updates.