PageRenderTime 54ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/build/doc/doc/integration/oauth_provider.md

https://gitlab.com/lavvy/artifacts-browser-demo
Markdown | 35 lines | 22 code | 13 blank | 0 comment | 0 complexity | a342228f14ff26bca1628f73ceee5b31 MD5 | raw file
  1. ## GitLab as OAuth2 authentication service provider
  2. This document is about using GitLab as an OAuth authentication service provider to sign into other services.
  3. If you want to use other OAuth authentication service providers to sign into GitLab please see the [OAuth2 client documentation](../api/oauth2.md)
  4. OAuth2 provides client applications a 'secure delegated access' to server resources on behalf of a resource owner. Or you can allow users to sign in to your application with their GitLab.com account.
  5. In fact OAuth allows to issue access token to third-party clients by an authorization server,
  6. with the approval of the resource owner, or end-user.
  7. Mostly, OAuth2 is using for SSO (Single sign-on). But you can find a lot of different usages for this functionality.
  8. For example, our feature 'GitLab Importer' is using OAuth protocol to give an access to repositories without sharing user credentials to GitLab.com account.
  9. Also GitLab.com application can be used for authentication to your GitLab instance if needed [GitLab OmniAuth](gitlab.md).
  10. GitLab has two ways to add new OAuth2 application to an instance, you can add application as regular user and through admin area. So GitLab actually can have an instance-wide and a user-wide applications. There is no defferences between them except the different permission levels.
  11. ### Adding application through profile
  12. Go to your profile section 'Application' and press button 'New Application'
  13. ![applications](img/oauth_provider_user_wide_applications.png)
  14. After this you will see application form, where "Name" is arbitrary name, "Redirect URI" is URL in your app where users will be sent after authorization on GitLab.com.
  15. ![application_form](img/oauth_provider_application_form.png)
  16. ### Authorized application
  17. Every application you authorized will be shown in your "Authorized application" sections.
  18. ![authorized_application](img/oauth_provider_authorized_application.png)
  19. At any time you can revoke access just clicking button "Revoke"
  20. ### OAuth applications in admin area
  21. If you want to create application that does not belong to certain user you can create it from admin area
  22. ![admin_application](img/oauth_provider_admin_application.png)