> For the complete documentation index, see [llms.txt](https://ajuda.rnp.br/cafe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.rnp.br/cafe/idp-cafe/faq/integrando-o-office-365-com-shibboleth-idp/office-365-configuracao-no-microsoft-entra.md).

# Office 365 - Configuração no Microsoft Entra

O Microsoft Entra (antigamente chamada de Azure AD) é a ferramenta destinada ao gerenciamento de usuários e controle de acesso no contexte de nuvem da Microsoft.

{% hint style="warning" %}

É necessário possuir um console PowerShell capaz de se conectar ao Microsoft Entra bem como as credenciais de administração.

> A configuração demandará as seguintes informações:
>
> * Domino da Insituição. Ex.: instituicao.edu.br
> * Endereço do IDP. Ex.: <https://idp.instituicao.edu.br>
> * Certificado digital usado pelo Shibbboleth IDP disponível em `/opt/shibboleth-idp/credentials/idp.crt`. Apenas o conteúdo, sem o delimitadores de inicio e fim. Ex.: MIIDpzCCAo8CAgPo...
>   {% endhint %}

Conecte-se no Microsoft Entra.

```powershell
Connect-MsolService
```

Faça a definição das variáveis necessárias para a autenticação federada.

{% hint style="warning" %}
Fique atendo as substituições necessárias.
{% endhint %}

```powershell
$dom = "Substituir pelo Domino da Insituição"
$idpHost="Substituir pelo Endereço do IDP"
$fedBrandName="IDP Instituicao"
$url = "$idpHost/idp/profile/SAML2/POST/SSO"
$ecpUrl = "$idpHost/idp/profile/SAML2/SOAP/ECP"
$uri = "$idpHost/idp/shibboleth"
$logoutUrl = "$idpHost/idp/profile/SAML2/POST/SLO"
$certData = "Substituir pelo Certificado digital"
```

Execute a configuração da autenticação federada.

```powershell
Set-MsolDomainAuthentication -DomainName $dom -federationBrandName $FedBrandName -Authentication Federated  -PassiveLogOnUri $url -SigningCertificate $certData -IssuerUri $uri -ActiveLogOnUri $ecpUrl -LogOffUri $logoutUrl -PreferredAuthenticationProtocol SAMLP
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.rnp.br/cafe/idp-cafe/faq/integrando-o-office-365-com-shibboleth-idp/office-365-configuracao-no-microsoft-entra.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
