sadium/public/en/posts/codeberg_x_nextcloud/index.html

296 lines
6.9 KiB
HTML
Raw Normal View History

2023-12-13 22:46:49 +03:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>Setup Codeberg as custom Oauth2 provider in Nexcloud :: Sadium</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="via Nextcloud Social Login" />
<meta name="keywords" content="" />
<meta name="robots" content="noodp" />
<link rel="canonical" href="/en/posts/codeberg_x_nextcloud/" />
<link rel="stylesheet" href="/styles.css">
<link rel="shortcut icon" href="/img/favicon/favicon.svg">
<meta name="twitter:card" content="summary" />
<meta property="og:locale" content="en" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Setup Codeberg as custom Oauth2 provider in Nexcloud">
<meta property="og:description" content="via Nextcloud Social Login" />
<meta property="og:url" content="/en/posts/codeberg_x_nextcloud/" />
<meta property="og:site_name" content="Sadium" />
<meta property="og:image" content="">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="627">
<meta property="article:published_time" content="2023-12-10 00:00:00 &#43;0000 UTC" />
</head>
<body class="red">
<div class="container center headings--one-size">
<header class="header">
<div class="header__inner">
<div class="header__logo">
<a href="/en">
<div class="logo">
Sadium
</div>
</a>
</div>
<ul class="menu menu--mobile">
<li class="menu__trigger">Menu&nbsp;</li>
<li>
<ul class="menu__dropdown">
<li><a href="/en/about">About</a></li>
<li><a href="/en/contacts">Contacts</a></li>
<li><a href="https://live.sadium.cyou">Live</a></li>
<li><a href="/en/posts">Posts</a></li>
<li><a href="/en/services">Services</a></li>
<li><a href="https://up.sadium.cyou">Status</a></li>
<hr />
<li>
<a href="/en/">EN</a>
</li>
<li>
<a href="/">RU</a>
</li>
</ul>
</li>
</ul>
<ul class="menu menu--desktop menu--language-selector">
<li class="menu__trigger">EN&nbsp;</li>
<li>
<ul class="menu__dropdown">
<li><a href="/en/">EN</a></li>
<li><a href="/">RU</a></li>
</ul>
</li>
</ul>
</div>
<nav class="navigation-menu">
<ul class="navigation-menu__inner menu--desktop">
<li><a href="/en/about" >About</a></li>
<li><a href="/en/contacts" >Contacts</a></li>
<li><a href="https://live.sadium.cyou" >Live</a></li>
<li><a href="/en/posts" >Posts</a></li>
<li><a href="/en/services" >Services</a></li>
<li><a href="https://up.sadium.cyou" >Status</a></li>
</ul>
</nav>
</header>
<div class="content">
<main>
<article>
<header>
<h1>Setup Codeberg as custom Oauth2 provider in Nexcloud</h1>
</header>
<p>I couldn&rsquo;t find any info about it via search engines, so I decided to put information here. <br>
What is helped - <a href="https://forgejo.codeberg.page/docs/latest/user/oauth2-provider/">https://forgejo.codeberg.page/docs/latest/user/oauth2-provider/</a></p>
<p><code>1.</code> <a href="https://codeberg.org/user/settings/applications">Create app in Codeberg</a> and copy Client ID and Client secret somewhere. <br>
<code>2.</code> Go to your Nextcloud Admin settings,<code>Social Login</code> section, and create Custom Oauth2 provider.</p>
<table>
<thead>
<tr>
<th>Section</th>
<th>What to enter</th>
</tr>
</thead>
<tbody>
<tr>
<td>Local/inner name</td>
<td>Codeberg</td>
</tr>
<tr>
<td>Name</td>
<td>Codeberg</td>
</tr>
<tr>
<td>API Base URL</td>
<td><a href="https://codeberg.org">https://codeberg.org</a></td>
</tr>
<tr>
<td>Authorize url</td>
<td><a href="https://codeberg.org/login/oauth/authorize">https://codeberg.org/login/oauth/authorize</a></td>
</tr>
<tr>
<td>Token url</td>
<td><a href="https://codeberg.org/login/oauth/access_token">https://codeberg.org/login/oauth/access_token</a></td>
</tr>
<tr>
<td>Profile url</td>
<td><a href="https://codeberg.org/login/oauth/userinfo">https://codeberg.org/login/oauth/userinfo</a></td>
</tr>
<tr>
<td>Logout url</td>
<td>leave empty</td>
</tr>
<tr>
<td>Client ID and Client secret</td>
<td>paste from step 1</td>
</tr>
<tr>
<td>Scope</td>
<td>read:user</td>
</tr>
<tr>
<td>Other after</td>
<td>leave empty if not sure</td>
</tr>
</tbody>
</table>
<p><code>3.</code> Tick <code>Allow users to attach/connect their social logins</code> box and click <code>Save</code> in the bottom of page. <br>
<code>4.</code> Go in Incognito/Private window of your browser, go to your Nextcloud login page and copy path of Codeberg provider - Right click, copy link, save somewhere. <br>
Must look like this - <code>https://cloud.example.org(/index.php)/apps/sociallogin/custom_oauth2/Codeberg</code> <br>
<code>5.</code> Go back to your created earlier <a href="https://codeberg.org/user/settings/applications">Codeberg application</a>, click <code>Edit</code> button and paste link from step 4 into <code>Redirection URI</code> section, click <code>Save</code>.</p>
<p>And you done! Try connect your Codeberg account to Nextcloud account from user settings <code>Social Login</code> section, it must work. In theory, it&rsquo;s also appliable to <code>Gitea</code>, because <a href="https://forgejo.org">Forgejo</a> is <a href="https://gitea.com">Gitea&rsquo;s</a> fork.</p>
<p>I&rsquo;ve created related Github issue: <a href="https://github.com/zorn-v/nextcloud-social-login/issues/440">https://github.com/zorn-v/nextcloud-social-login/issues/440</a></p>
</article>
<aside>
<nav id="TableOfContents"></nav>
</aside>
</main>
</div>
<footer class="footer">
<div class="footer__inner">
<div class="copyright">
2023-12-24 15:04:36 +03:00
<span>Powered by <a href="https://gohugo.io">Hugo</a> ::</span>
<span><a href="https://github.com/panr/hugo-theme-terminal" target="_blank">Theme</a> by <a href="https://github.com/panr" target="_blank">panr</a> ::</span>
<span>&nbsp;<a href="https://git.sadium.cyou/SadmL/sadium">Mod</a>. by <a href="https://git.sadium.cyou/SadmL">SL</a> ::</span>
<span>&nbsp;<a href="/tos">ToS</a> ::</span>
<span>&nbsp;<a href="https://choosealicense.com/licenses/cc-by-4.0/">CC-BY-4.0</a> ::</span>
<span>&nbsp;2023</span>
2023-12-13 22:46:49 +03:00
</div>
</div>
</footer>
<script type="text/javascript" src="/bundle.min.js"></script>
</div>
</body>
</html>