<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>authenticate | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/authenticate/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Thu, 02 Jan 2020 11:28:16 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>authenticate | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Python 連線 MongoDB 驗證身份</title>
		<link>https://sdt.hameba.tw/385/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-%25e9%2580%25a3%25e7%25b7%259a-mongodb-%25e9%25a9%2597%25e8%25ad%2589%25e8%25ba%25ab%25e4%25bb%25bd</link>
				<comments>https://sdt.hameba.tw/385/#respond</comments>
				<pubDate>Sun, 29 Dec 2019 15:12:04 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[authenticate]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[pymongo]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=385</guid>
				<description><![CDATA[<p>上一次有提到  Python 連線 MongoDB ， 這次來補充如果要驗證身份的話，要怎麼處理。 首先在Mo &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/385/" class="more-link">閱讀全文<span class="screen-reader-text">〈Python 連線 MongoDB 驗證身份〉</span></a></p>
The post <a href="https://sdt.hameba.tw/385/">Python 連線 MongoDB 驗證身份</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>上一次有提到  <a href="https://sdt.hameba.tw/367/" target="_blank" rel="noopener noreferrer">Python 連線 MongoDB</a> ，</p>
<p>這次來補充如果要驗證身份的話，要怎麼處理。</p>
<p><span id="more-385"></span></p>
<p>首先在MongoDB建立一個使用者，</p>
<p>設定好使用者名稱、密碼、角色。</p>
<p>再來看一下程式要怎麼調整：</p>
<div>
<div>
<pre class="crayon-plain-tag">client = MongoClient('YOUR_DB_IP', 27017)
db = client[MONGO_DB]
db.authenticate(MONGO_USER_NAME, MONGO_USER_PWD)</pre>
</div>
<p>&nbsp;</p>
</div>
<p>&nbsp;</p>
<p>參考資料：</p>
<p><a href="https://api.mongodb.com/python/current/examples/authentication.html">https://api.mongodb.com/python/current/examples/authentication.html</a></p>The post <a href="https://sdt.hameba.tw/385/">Python 連線 MongoDB 驗證身份</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/385/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
