Clancey / simple_auth

The Simplest way to Authenticate in Flutter
MIT License
353 stars 108 forks source link

microsoftLive.dart needs updating #5

Open samgithub-duplicate opened 6 years ago

samgithub-duplicate commented 6 years ago

microsoftLive.dart needs to be updated to use the Azure AD v2.0. The v2.0 endpoints supports both the Aure AD tenants and consumer accounts like hotmail/outlook. Please see

https://developer.microsoft.com/en-us/graph/docs/concepts/auth_overview

The token endpoints for v2 are:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize https://login.microsoftonline.com/common/oauth2/v2.0/token

The other change is for Redirect URI's: For native and mobile apps this is a URI assigned by Azure AD. -- according to the first link that I provided. By Azure AD they are referring to 'common'

The third change is that the client_secret is NOT required for 'native' apps.

If you get a chance to make the update, I'll be happy to test it and write usage documentation for the MicrosoftLive component

Thanks

jeffosmith commented 5 years ago

@Clancey I implemented a connection to AD V2 for a project I did, happy to wrap that up into the Library. Will raise a PR in the next week or so.

Clancey commented 5 years ago

Awesome Thanks!

tabinnorway commented 5 years ago

@jeffosmith

Could you give some information on how you did this? I am currently unable to log into AzureAD using this library, and I would like to showcase Flutter for my company. Without Azure login, I can't. I am gettiong the "missingapiversionparameter" from Microsoft. I am going to look at it next week in more detail, so I might find a solution, but would love to hear if you found something, then I don't have to go look :-)

jeffosmith commented 5 years ago

@tabinnorway Sorry, just saw this over the weekend. I'll can take a look over the next day or so, I haven't seen that issue before, and am using this to connect to an Azure Active Directory at the moment. Can you share your AzureADV2ApiDeclation? Block out the ID's if you are concerned.

Here is an example of one I use.

@AzureADV2ApiDeclaration( "EmlApi", aad_app_id, "sb://auth", azureTennant: aad_tenant_id, scopes: [ "openid", "profile", ], )