Skip to main content

Como configurar um Guia do Provedor OAuth da Microsoft

How to configure a Microsoft OAuth Provider

1. Intro 

Introdução

ThisEste guideguia willexplicará explaincomo howconfigurar toum configurecliente a client onno Microsoft Azure ande thenusar useas theinformações information fromdo Microsoft Azure topara configureconfigurar anum provedor OAuth Providerno in SuiteCRM.HelloCloud.

2.

Registre Register SuiteCRMum App inHelloCloud Microsoft 

na Microsoft

TheAs following steps assume that you are configuringetapas a providerseguir forpressupõem aque companyvocê accountesteja thatconfigurando willum beprovedor sharedpara amonguma manyconta users.corporativa que será compartilhada entre vários usuários.

2.1.

Ir Gopara toRegistros Appde Registrations 

aplicativos

Go to Acesse https://portal.azure.com/ ande faça login

OnNa thepágina homeinicial, pagevocê youverá shoulduma seetela como a screen like the followingseguinte

azure-homepage.png

CheckVerifique ifse there is aum link to para AppRegistro Registrationsde aplicativos onna thepágina homeinicial, page,deve shouldser lookalgo somethingcomo likeo the followingseguinte

azure-services.pnghelp_azureregappico.png

Otherwise,Caso gocontrário, to vá para MoreMais servicesserviços e procure o link Aplicativos empresariais and then search for the App Registrations link

more-services.png

azure-services-app-registration-entry.png

TheA Azure Apppágina Registrations pagede looksregistros likede theaplicativos followingdo Azure se parece com a seguinte

azure-app-registrations.pnghelp_azureregapp.png

 

Crie um novo registro de Aplicativo

Na página Registros de aplicativos clique no link "Novo registro"

2.2.help_azureappbtnew.png

Create

Você deve então ver a Newpágina Appde Registration criação

Onde the Appregistro Registrations pagedo clickaplicativo. onNa thepágina "Newde Registration"registro, linkpreencha o seguinte:

azure-new-app-registration-link.png

You should then see the App registration creation page

On the registration page complete the following:

  1. AddAdicione aum namenome forpara theo registrationregistro likecomo "SuiteCRM"HelloCloud"

  2. SelectSelecione oneum of thedos "SupportedTipos accountde types"conta dependingsuportados" ondependendo yourde needssuas necessidades

    1. NoteNota InNeste thisexemplo examplevamos we are going to useusar "Single tenant", thatisso doesnão notsignifica meanque itseja iso theúnico onea toser beusado usedpara fortodos everyos scenario.cenários.

    2. YouVocê shoulddeve selectselecionar thea optionopção thatapropriada ispara appropriateseu forcaso yourde use caseuso

  3. SetDefina aum "RedirectURI URI"de redirecionamento". ThisIsso shoulddeve beser similarsemelhante to: a: https://<your-suitecrm-instance-hostnome>/.hellocloud.com.br/index.php?entryPoint=setExternalOAuthToken

    1. Note Azure only allows https connections to host that aren’t the localhost. (the azure interface will alert you to it)

      1. A host like http://my-suitecrm.com/index.php?entryPoint=setExternalOAuthToken is not valid

      2. ANota hostO like https://my-suitecrm.com/index.php?entryPoint=setExternalOAuthToken isAzure validpermite apenas conexões https para hospedar que não sejam o localhost. (a interface azul irá alertá-lo sobre isso)

      3. A host like http://localhost/index.php?entryPoint=setExternalOAuthToken is valid

azure-new-app-registration-with-info.pnghelp_azureappreg.png

AfterApós fillingpreencher inos thedados informationprossiga proceedcom witho the registrationcadastro

AfterApós theo registrationregisto youdeverá shouldser beredireccionado re-directedpara to thea "detailvisualização view"de ofdetalhe" thedo registration.registo.

azure-main-app-registration-page.pnghelp_azureappregistered.png

There youvocê willencontrará find Application (client) ID that isque the é o Client Id that willque needprecisará toser beconfigurado configuredposteriormente laterno on SuiteCRM.HelloCloud.

azure-client-id.png

2.3.Criar Createo aSegredo clientdo secret Cliente

TheO nextpróximo steppasso toé takegerar isum to"segredo generatedo cliente" que será usado pelo HelloCloud para se comunicar com a "client secret" that will be used by SuiteCRM to communicate with Microsoft.

OnNa yourpágina Appprincipal Registrationdo mainRegistro pagedo clickaplicativo, clique em "AddAdicionar aum certificatecertificado orou secret"segredo".

azure-add-secret.pnghelp_azureappcert.png

ThisIsso shoulddeve takelevá-lo youà to thepágina "CertificatesCertificados &e secrets" pagesegredos"

azure-cerfiticates-and-secrets-page.pnghelp_azureappcerthome.png

HereAqui youvocê canpode generategerar um novo segredo clicando em "Novo segredo do cliente"

help_azurebtnewcert.png

Uma barra lateral deve abrir onde você pode colocar o nome do segredo que deseja fornecer ao seu segredo e sua duração. Depois de definir o nome e a newduração, secretclique by clickingem "New Client Secret"

azure-new-client-secret.png

A sidebar should open where you can place the name of the secret you want to give to you secret and its duration. After setting the name and the duration click "Add"Adicionar".

azure-add-a-client-secret-sidebar.pnghelp_azureappaddcert.png

ThisIsso shoulddeve generategerar auma newnova linelinha onna thetabela da página "CertificatesCertificados &e secrets" page tablesegredos"

azure-new-client-secret.pnghelp_azureappcertlist.png

YouVocê shoulddeve copycopiar theo "Value" byValor" (clickingclicando theno iconícone nextao tolado) it)para foro yourseu newnovo secretsegredo ande storearmazená-lo item inalgum somelugar safeseguro. place.Você Younão won’tpoderá beacessar ableesse tovalor accessnovamente thisna valueinterface again from thedo Microsoft AzureAzure. interface.O Thesegredo secretserá willexigido bena requireddocumentação ondo the SuiteCRM documentation.HelloCloud.

azure-secret-value.png

NowAgora govolte backpara toa yourpágina Appprincipal Registrationde mainregistro page,do byaplicativo, clickingclicando em "Overview"Visão ongeral" thena sidebar.barra lateral.

azure-link-to-app-registration-overview.png 

2.4.

Defina Defineos theescopos authorized scopes 

autorizados

OurNosso nextpróximo steppasso isé toconfigurar configureos theescopos scopesque thato SuiteCRMHelloCloud willpoderá be able to access.acessar.

BackDe onvolta yourà Apppágina Registrationprincipal mainde pageregistro do aplicativo

azure-main-app-registration-page.png

Clique

Clicknas onpermissões "ViewVer as permissões de API" permissions

azure-view-api-permissions-link.png

ThisIsso shoulddeve takelevá-lo youà to thepágina "ApiPermissões Permissions"da pageAPI"

azure-view-api-permissions-link.pnghelp_azureappapi.png

NowAgora letsvamos addadicionar theos scopesescopos thatque wepermitimos. allow.Clique Clickem "AddAdicionar auma permission"permissão"

azure-add-permission-link.png

ThisIsso shoulddeve openabrir auma sidebarbarra lateral

azure-add-permission-sidebar-clean.png

TheAs permissionspermissões weque wantqueremos areestão under theno Microsoft Graph. SoEntão clickclique onem "Microsoft Graph".

azure-microsoft-graph-permissions-link.png

AfterDepois clickingde youclicar, shouldvocê bedeve promptedser withperguntado whichsobre kindo oftipo permissionde youpermissão wantque todeseja use.usar.

azure-microsoft-graph-permission-types.png

Go aheadem andfrente clicke clique em "DelegatePermissões permissions"delegadas"

azure-delegated-permissions-link.png

YouAgora shouldvocê nowdeve seever uma nova seção "Solicitar permissões de API".

Na barra de pesquisa, digite offline_access, que deve mostrar a newpermissão offline_access. Selecione-o e clique em "SelectAdicionar permissions" section.

In the search bar type offline_access, that should show the offline_access permission. Select it add then click "Add permissions"permissões"

azure-add-offline-access-permission.png

RepeatRepita theo processprocesso forpara theas followingseguintes permissions:permissões: .  IMAP.AccessAsUser.All All .  User.Read

azure-add-imap-permission.pngazure-add-user-read-permission.png

AfterDepois youde addadicionar alltodas theas abovepermissões permissions,acima, yoursua permissionstabela tablede shouldpermissões lookdeve somethingter likea theseguinte following:aparência:

azure-api-permissions-page-with-values.png

NowAgora govolte backpara toa yourpágina Appprincipal Registrationde mainregistro page,do byaplicativo, clickingclicando em "Overview"Visão ongeral" thena sidebar.barra lateral.

azure-link-to-app-registration-overview.png 

2.5.

Defina Define the Return URI 

Our next step is to set the configurations on the "Authentication" like the Returna URI andde others.retorno

Nosso próximo passo é definir as configurações na "Autenticação" como o URI de retorno e outros.

BackDe onvolta yourà Apppágina Registrationprincipal mainde pageregistro do aplicativo

azure-main-app-registration-page.png 

Click the "Redirect URIs" link

azure-redirect-uri-link.png

ThisIsso shoulddeve haveter takenlevado youvocê topara thea página "Authentication" page.Autenticação".

HereAqui youvocê shoulddeve seever the Returno URI thatde youretorno previouslyque configuredvocê configurou anteriormente

azure-redirect-uri-list.pnghelp_azureappuri.png

AfterDepois thatdisso, enablehabilite thea opção "AccessTokens tokensde acesso (usedusados forpara implicitfluxos flows)implícitos)" optionna onseção theConcessão Implicitimplícita grante andfluxos hybrid flows sectionhíbridos

azure-enable-access-token.pnghelp_azureappuritk.png

NowAgora govolte backpara toa yourpágina Appprincipal Registrationde mainregistro page,do byaplicativo, clickingclicando em "Overview"Visão ongeral" thena sidebar.barra lateral.

azure-link-to-app-registration-overview.png 

2.6.

Resgate Retrievea theinformação endpointdo information 

Ponto de extremidade

TheA lastúltima stepetapa youque needvocê toprecisa takeexecutar isé torecuperar retrieveos the followingseguintes endpoints:

  1. Ponto de extremidade de autorização OAuth 2.0 authorization endpoint

  2. Ponto de extremidade de autorização OAuth 2.0 authorization endpoint (v2)

De

volta
à

Backpágina onprincipal yourde Appregistro Registrationdo main pageazure-main-app-registration-page.pngaplicativo

ClickClique inno thelink "Endpoints"Pontos link.de extremidade".

azure-endpoints-link.pnghelp_azureappendp.png

ThisIsso shoulddeve openabrir uma barra lateral como a sidebar like the followingseguinte

azure-endpoints-sidebar.pnghelp_azureendp.png

FromNa thebarra sidebarlateral, copycopie ande takeanote noteos ofseguintes thepontos followingde endpoints,extremidade, thatque willserão benecessários requiredpara toconfigurar configureo SuiteCRMHelloCloud

azure-required-endpoints.pnghelp_azurecp.png

3.

Configure theo Provedor da Microsoft Providerno in SuiteCRM 

HelloCloud

InNas the following steps we are going to configureetapas a providerseguir, thatvamos canconfigurar beum usedprovedor byque multiplepode usersser withinusado SuiteCRM.por Thisvários scenariousuários onlyno makesHelloCloud. senseEste whencenário you havefaz registeredsentido anquando appvocê inregistrou um aplicativo no azure forpara accountscontas thatque sharecompartilham theo samemesmo domain,domínio, usuallygeralmente accountscontas thatque arenão notsão contas do @outlook accountsou or similar.similares.

SinceComo wevamos areconfigurar goingum toprovedor configureGroup OAuth, as etapas a Groupseguir OAuthdevem provider,ser theexecutadas followingpor stepsum areusuário needed to be done by an admin useradministrador

LoginFaça intologin SuiteCRMno asHelloCloud ancomo adminusuário useradministrador ande go topara theo adminpainel panelde administração

suitecrm-admin-panel.pnghelp_users.png

OnNo thepainel adminde paneladministração, searchprocure forpor "External OAuth Providers"

suitecrm-external-oauth-provider-admin-panel.pnghelp_hcextprov.png

ClickClique on theem "External OAuth Providers", thatque shoulddeve takelevá-lo youà tovisualização theda modulelista listde viewmódulos

suitecrm-external-oauth-provider-module.pnghelp_extprov.png

AsComo anadministrador, adminvocê youpode cancriar createdois twotipos typesde of records:registros:

  1. PersonalPessoal

    1. TheseEstes aresão onlyacessíveis accessibleapenas bypelo theusuário userque thatos created themcriou

    2. PersonalOs recordsregistros arepessoais meantdevem toser beusados usedao whenconfigurar configuringo access to personal accounts in exiting providers, withoutacesso a customcontas domain.pessoais I.e.em whenprovedores forexistentes, intancesem configuringum accessdomínio topersonalizado. your @gmail or @outlook accounts.ou Theseseja canpor haveexemplo, aao sharedconfigurar groupo configurationacesso asàs forsuas eachcontas @gmail ou @outlook . usedEstes thepodem ter uma configuração de grupo compartilhada, pois para cada campo usado o "ClientID Id"do cliente", "ClientSegredo Secret"do andcliente" othere fieldsoutros arecampos goingserão toexclusivos bepor unique per account.conta.

  2. GroupGrupo

    1. RecordsRegistros thatque willserão beusados usedpor bymuitos many usersusuários

    2. GroupOs recordsregistros arede meantgrupo todevem beser useusados bypor everyonetodos thatque havetêm accountscontas thatque sharecompartilham theo samemesmo domain,domínio, lie como @example-inc.onmicrosoft.com.com. TheO "ClientID ID"do cliente", "ClientSegredo Secret"do andcliente" thee otheros fieldsdemais arecampos goingserão toos bemesmos thepara sametodas foras allcontas accountsque thatusam useeste this domain.domínio.

Conforme

mencionado

Asanteriormente mentionedneste beforeguia, invamos thisconfigurar guideum weprovedor areque goingserá tousado configurepor avários providerusuários, thatentão willvamos becriar usedum byregistro multiplede users, so we are going to create a group record.grupo.

ClickClique on theem "New Group OAuth Provider", whichque shoulddeve takelevá-lo youpara toa thevisualização createde view.criação.

AddAdicione aum meaningfulnome namesignificativo toao yourseu provider,provedor, itpode canser be justapenas "Microsoft", theo namenome ofdo yourseu domain,domínio orou somethingalgo thatque helpso youajude identifya andidentificar differentiatee thediferenciar providero fromprovedor otherde possibleoutros providers.possíveis provedores.

ThenEm selectseguida, theselecione "Microsoft" onno campo "Connector" fieldConector"

suitecrm-connector-selection.pnghelp_hcconn.png

TheO tipo de conector Microsoft connectorfunciona typeda worksmesma informa theque sameo waytipo asde theconector "Generic"Genérico". connectorA type.diferença Theé differenceque isele thatpossui itvários haspadrões severalembutidos. builtIsso inpoupa defaults.algumas Thisetapas sparesde youconfiguração somee configurationfacilita stepso andprocesso makesde theconfiguração processde ofum configuring an Externalprovedor OAuth provider easier.externo.

AddAdicione theos "Scopes"Escopos" thatque youvocê wantdeseja toacessar, access,os themesmos sameque onesvocê you’veconfigurou configuredna onpágina Azure’sPermissões de API Permissionsdo page.Azure.

suite_crm_oauth_provider_scopes.pnghelp_hcscope.png

SetDefina theo "ClientID Id"do thatcliente" wasque generatedfoi ingerado no Azure

suitecrm-oauth-provider-client-id.pnghelp_hccliid.png

SetDefina theo "ClientSegredo Secret"do thatCliente" wasque generatedfoi ingerado no Azure

suitecrm-oauth-provider-client-secret.pnghelp_hcclisec.png

SetDefina theo "AuthorizeURL URL"de thatautorização" you’veque copiedvocê fromcopiou thedos pontos de extremidade do Azure endpoints(ponto (de extremidade de autorização OAuth 2.0 authorization endpoint (v2) )

azure-authorize-url.pngsuitecrm-oauth-provider-authorize-url.png

Sethelp_authurl.png

the

Defina o "AccessURL Tokendo URL"token thatde you’veacesso" copiedque fromvocê thecopiou dos pontos de extremidade do Azure endpoints(ponto (de extremidade do token OAuth 2.0 token endpoint (v2) )

azure-access-token-url.png

suitecrm-oauth-provider-access-token-url.pnghelp_authtk.png

YourSeu recordregistro shouldagora nowdeve lookse somethingparecer likecom theo following:seguinte:

suitecrm-oauth-provider-filled-example.pnghelp_hc.png

SinceComo manymuitos ofdos theoutros othercampos fieldstêm havepadrões defaultse ando theconector da Microsoft connectoradiciona addsoutros otherpadrões, defaults,esses thesesão aretodos allos thecampos fieldque thatvocê youprecisa should need to configure.configurar.

YouAgora canvocê nowpode savesalvar theo recordregistro

4.

Configure Usero InboundE-mail emails 

de Entrada do Usuário

NowAgora usersos shouldusuários bedevem ablepoder tousar useo theProvedor OAuth Providerque youvocê havecriou createdpara forautenticação authenticatingcom witha Microsoft.

CheckVerifique the Howo toguia Como configureconfigurar Inbounde-mail Emailde withentrada OAuthcom guideOAuth para ver as etapas que os usuários precisam seguir para configurar seus e-mails de entrada usando uma conexão OAuth.

 for the steps users need to take to configure their inbound emails using an OAuth connection.