Open RoarGronmo opened 3 years ago
It's basically two different ways of Sending Authorization Request
to the Authentication Server and Receiving the code
back.
In WebView Section,
Your basically OPENING the authorizationUrl
link in WebView.
String authorizationUrl = '${authorizationEndPoint}?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=${responseType}&grant_type=${grantType}&state=${state}'
using Navigation Delegate we LISTEN to the NavigationRequests and when the OAuth Server authenticates the user it redirects to the redirectUrl
String redirectUrl = '${redirectUri}?code=${code}&state=${state}'
Then You Parse the code
from the redirectUrl and use it to exchange with access_token by sending a post request to tokenEndPoint.
For More Details refer flutter_dauth's WebView implementation. DAuth is an OAuth2.0 based SSO (Single Sign On) for my university students, the flutter_dauth package is for Client-Side Integration of DAuth and this package was highly inspired from oauth2 package and currently supports Authorization Code Flow
. Feel free to take a look into the repo for reference.
In url_launcher & uni_links section,
redirectUrl
specified.
Referencing to the expanding part of 'Readme' in
https://pub.dev/packages/oauth2
Could you please referase this section so the code works...
It is unclear where theese two section should go, and how is linksStream used ?