script and get the client ID and all that I need, to make it work with the OAuth

Jack M 0 Reputation points
2024-10-06T19:54:31.9933333+00:00

Hi,

I have this script below that no longer works. I researched and it says that I need to register with Azure. When I go try to register with Azure it asks me for a service?.....what service?....it does not work.

Please anyone send me a step by step directions, with links and all if possible, as where to go register my script and get the client ID and all that I need, to make it work with the OAuth ?

import imaplib

import email

import time

Connect to the server and login

mail = imaplib.IMAP4_SSL("outlook.live.com")

mail.login("ccccccc@live.com", "password")

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,114 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. akinbade abiola 18,305 Reputation points
    2024-10-06T22:06:34.71+00:00

    Hello Jack M,

    Thanks for your question

    To do this:

    Head over to the Microsoft Entra Admin Center to start the process.

    Follow the steps here to register your app: https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate

    Then proceed to complete using the steps here

    https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth?source=recommendations#get-an-access-token

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola


  2. Jack M 0 Reputation points
    2024-10-07T02:27:20.4533333+00:00

    When I "Head over to the Microsoft Entra Admin Center to start the process."

    I get this below

    User's image

    Now what do I do......Please help.

    0 comments No comments

  3. Akhilesh Vallamkonda 10,320 Reputation points Microsoft Vendor
    2024-10-17T18:33:16.84+00:00

    Hi @Jack M

    Thank you for reaching us!

    In order to Register an application with the Microsoft identity platform you need to assign the privileged role which is Cloud Application Administrator.
    please follow how to Assign Microsoft Entra roles to users and proceed with your steps as above.

    Hope this helps. Do let us know if you any further queries by responding in the comments section.

    Thanks,

    Akhilesh,


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.