Authentication with Azure Active Directory - how to accept user credentials programmatically

Marty

Is there any way to login via web application or web api to Azure Active Directory (with AD credentials) using my own username and password page which is hosted outside of Azure?

From my investigation it seems there is no programmatic way to send username and password to authenticate users with Azure AD (if you hosted an app outside of Azure) Not sure if they consider this to be a security hole of some sort (i dont think it is it https is enforced?)

Seems like you can only authenticate users by going through the code grant (which means popping out of our application to sign on to an external site).

Ultimately I want to create a python flask api that can authenticate against Azure AD directly if possible. I have done this in the past (with other auth systems) with the Oauth grant_type=password to send username and pass, but dont think this is supported in Azure AD (correct me if im wrong?) I know grant_type=client_credentials is supported, but that seems like its service to service auth, which is not quite what im after http://msdn.microsoft.com/en-us/library/azure/dn645543.aspx

If its not possible to have a login page hosted outside of Azure for this, is it even possible to have one inside of Azure, seems like from examples here: http://msdn.microsoft.com/en-us/library/azure/bc8af4ff-66e7-4d5b-b3d4-c33d2c55d270#BKMK_Browser There is no custom login page with a password field .. (only open id logins it seems)

Philippe Signoret

The Resource Owner Password Credentials Grant (grant_type=password) flow is supported by Azure Active Directory. However, before using it, consider if it is truly required. As it says in the OAuth 2.0 RFC:

The resource owner password credentials (i.e., username and password) can be used directly as an authorization grant to obtain an access token. The credentials should only be used when there is a high degree of trust between the resource owner and the client (e.g., the client is part of the device operating system or a highly privileged application), and when other authorization grant types are not available (such as an authorization code).

If you have determined that the other supported flows will definitely not work for your scenario, then also be sure to follow the second bit of advice in the RFC:

Even though this grant type requires direct client access to the resource owner credentials, the resource owner credentials are used for a single request and are exchanged for an access token. This grant type can eliminate the need for the client to store the resource owner credentials for future use, by exchanging the credentials with a long-lived access token or refresh token.

(Emphasis added in both cases.)

There's a .NET and ADAL sample on GitHub that uses this flow, and it should be simple enough to implement in Python: https://github.com/AzureADSamples/NativeClient-Headless-DotNet

Edit: You can host your application anywhere you want, it doesn't need to be on Azure. This applies to all flows.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Azure Active Directory: Get user's UPN with OpenID Connect authentication

From Dev

Azure, Active Directory: how to create new user

From Dev

Azure Active Directory and Windows Authentication

From Dev

Authentication of a WebAPI with Azure Active Directory

From Dev

Azure Active Directory and WCF authentication

From Dev

Authentication failed with Azure Active Directory in Windows Phone

From Dev

Azure Active Directory Organizational Authentication Mechasnim

From Dev

Passing parameters to Azure Active Directory authentication

From Dev

Using Active Directory for Authentication locally and on Azure

From Dev

Azure Active Directory Organizational Authentication Mechasnim

From Dev

Using windows authentication to log on to Azure Active Directory

From Dev

How to check if an azure active directory user is already in an approle

From Dev

How to check if a user that is in Azure Active Directory belongs to a specific group membership?

From Dev

How to authenticate to Azure Active Directory without user interaction?

From Dev

How to access Azure Active Directory?

From Dev

Azure Service Management API authentication using Azure Active Directory Oauth

From Dev

Azure Service Management API authentication using Azure Active Directory Oauth

From Dev

In Azure Active directory user disable option is there?

From Dev

Azure Active Directory user roles and authorization

From Dev

How to do Active Directory authentication in Razor (cshtml)

From Dev

How to do Active Directory authentication in Razor (cshtml)

From Dev

Programmatically add @mention for Active Directory User Account in on-prem Azure DevOps Server work item comment (Jan, 2021)

From Dev

How to populate Azure Active Directory B2C user custom user attributes?

From Dev

Get Active Directory User Information With Windows Authentication in MVC 4

From Dev

Impersonate a Active Directory user in MVC application with Windows Authentication

From Dev

Get Active Directory User Information With Windows Authentication in MVC 4

From Dev

Impersonate a Active Directory user in MVC application with Windows Authentication

From Dev

Java Spring Security - Application Role Based Active Directory User Authentication

From Dev

User authentication through private IP LDAP/Active Directory from website

Related Related

  1. 1

    Azure Active Directory: Get user's UPN with OpenID Connect authentication

  2. 2

    Azure, Active Directory: how to create new user

  3. 3

    Azure Active Directory and Windows Authentication

  4. 4

    Authentication of a WebAPI with Azure Active Directory

  5. 5

    Azure Active Directory and WCF authentication

  6. 6

    Authentication failed with Azure Active Directory in Windows Phone

  7. 7

    Azure Active Directory Organizational Authentication Mechasnim

  8. 8

    Passing parameters to Azure Active Directory authentication

  9. 9

    Using Active Directory for Authentication locally and on Azure

  10. 10

    Azure Active Directory Organizational Authentication Mechasnim

  11. 11

    Using windows authentication to log on to Azure Active Directory

  12. 12

    How to check if an azure active directory user is already in an approle

  13. 13

    How to check if a user that is in Azure Active Directory belongs to a specific group membership?

  14. 14

    How to authenticate to Azure Active Directory without user interaction?

  15. 15

    How to access Azure Active Directory?

  16. 16

    Azure Service Management API authentication using Azure Active Directory Oauth

  17. 17

    Azure Service Management API authentication using Azure Active Directory Oauth

  18. 18

    In Azure Active directory user disable option is there?

  19. 19

    Azure Active Directory user roles and authorization

  20. 20

    How to do Active Directory authentication in Razor (cshtml)

  21. 21

    How to do Active Directory authentication in Razor (cshtml)

  22. 22

    Programmatically add @mention for Active Directory User Account in on-prem Azure DevOps Server work item comment (Jan, 2021)

  23. 23

    How to populate Azure Active Directory B2C user custom user attributes?

  24. 24

    Get Active Directory User Information With Windows Authentication in MVC 4

  25. 25

    Impersonate a Active Directory user in MVC application with Windows Authentication

  26. 26

    Get Active Directory User Information With Windows Authentication in MVC 4

  27. 27

    Impersonate a Active Directory user in MVC application with Windows Authentication

  28. 28

    Java Spring Security - Application Role Based Active Directory User Authentication

  29. 29

    User authentication through private IP LDAP/Active Directory from website

HotTag

Archive