junn.net
  • Home
  • Curriculum Vitae
Categories
Tags
AI์นผ๋Ÿผ (6) anaconda (5) C5060W (5) espaรฑol (6) fine art (11) Flex (5) Inca Trail (11) Israel (13) jazz (9) jupyter (5) Kyoto (4) Latex (8) oil painting (11) Peru (11) python (12) R (8) R์นผ๋Ÿผ (7) Steem (6) wordpress (10) ๊ตํ†  (7) ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค (5) ๋„์ฟ„ (4) ๋”ฅ๋Ÿฌ๋‹ (4) ๋ฎค์ง€์ปฌ (9) ๋ฏธ์ˆ  (13) ์„ฑํ˜•์™ธ๊ณผ (6) ์ŠคํŽ˜์ธ์–ด (6) ์‹ค์Šต์ด์•ผ๊ธฐ (5) ์•ผ๊ฒฝ (7) ์˜ค์‚ฌ์นด (4) ์›Œ๋“œํ”„๋ ˆ์Šค (7) ์œ ๋Ÿฝ์—ฌํ–‰ (13) ์œ ํ™” (11) ์˜ํ•™์นผ๋Ÿผ (12) ์ด์Šค๋ผ์—˜ (7) ์ดํƒˆ๋ฆฌ์•„ (4) ์ผ๋ณธ (6) ์ผ๋ณธ์—ฌํ–‰ (7) ์ž‰์นด (5) ์ž‰์นดํŠธ๋ ˆ์ผ (9) ์žฌ์ฆˆ (8) ์ค‘๊ตญ (4) ์ค‘๊ตญ์—ฌํ–‰ (5) ํŽ˜๋ฃจ (11) ํ™˜์ž (6)
junn.net from 2007
RSS Feed
junn.net from 2007
  • Home
  • Curriculum Vitae
๐Ÿ’ป๐Ÿ’ป Programming

Steemconnect Example #1. Login from your site other than steemit.com

  • byJ Seok
  • August 4, 2017
0
Shares
0
0
0
0

WordPress post : http://junn.net/archives/601

Reference #1 : https://steemit.com/tutorial/@krnel/tutorial-how-to-add-steemit-login-to-your-site-with-steemconnect

Reference #2 : https://github.com/busyorg/steemconnect

Source :

https://github.com/junn279/steemjs_example/blob/master/steem04.php

https://github.com/junn279/steemjs_example/blob/master/steem04_sub.php

 

Obviously, it has been already posted in Ref#1 how to use steemconnect for login from my site. But I think there are something to summarize when I was tested.

์ด๋ฏธ ํ›Œ๋ฅญํ•œ ์˜ˆ์ œ๊ฐ€ ์ฒซ๋ฒˆ์งธ ๋ ˆํผ๋Ÿฐ์Šค ์‚ฌ์ดํŠธ์— ๋“ค์–ด๊ฐ€๋ฉด ๋ณผ ์ˆ˜ ์žˆ๊ณ , (์‚ฌ์‹ค ๋‹ค ์จ์žˆ๋‹ค) ๋‹ค๋งŒ ๋ญ”๊ฐ€ ์ •๋ฆฌ๊ฐ€ ์กฐ๊ธˆ ๋” ํ•„์š”ํ•œ ๋“ฏํ•ด์„œ ํฌ์ŠคํŒ…ํ•˜๊ธฐ๋กœ ์ƒ๊ฐํ–ˆ๋‹ค.

 

์™ธ๋ถ€๋กœ๊ทธ์ธ์„ ์œ„ํ•ด Steemconnect ๋ผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ(๋˜๋Š” ์‚ฌ์ดํŠธ)๋ฅผ ์ด์šฉํ•  ๊ฒƒ์ด๋‹ค. ๋กœ๊ทธ์ธ ์ฐฝ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋‚˜์˜ค๋Š”๋ฐ๋ฐ, ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” posting key๋ฅผ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. posting key๋ฅผ ์–ป๋Š” ๋ฐฉ๋ฒ•์€ ์ด์ „ ์˜ˆ์ œ์— ์„œ์ˆ ํ–ˆ์—ˆ์ง€๋งŒ, ๊ฐ„๋‹จํ•˜๊ฒŒ๋Š” Wallet์˜ Permission์— ๋“ค์–ด๊ฐ€์„œ posting ์˜ show private key๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ๊ตฌํ•  ์ˆ˜ ์žˆ๋‹ค.

For outside login, we can use Steemconnect library (or site). Login window is as below, we can use posting key as password. Easily, we can get posting key in Wallet of Steemit.com, and click Permissions and click Show Private Key Button.

Posting Key๋ฅผ ์ด์šฉํ•ด์„œ ๋กœ๊ทธ์ธ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

Now we setup the App,

 

์•ฑ์„ ์„ธํŒ…ํ•˜๊ฒŒ๋˜๋Š”๋ฐ, ์—ฌ๊ธฐ์„œ ์กฐ๊ธˆ ์• ๋งคํ•œ? ๋ถ€๋ถ„์ด, ์ผ๋‹จ ๋‚ด ์•„์ด๋””๊ฐ€ ๊ณง App ID๊ฐ€ ๋œ๋‹ค. ๋งŒ์•ฝ ‘์„œ๋น„์Šคํ•˜๋Š” ์•ฑ’์˜ ์ด๋ฆ„์ด ๋‚ด ์•„์ด๋””๊ฐ€ ์•„๋‹ˆ๊ธธ ์›ํ•œ๋‹ค๋ฉด https://steemit.com/news/@timcliff/new-tool-from-busy-org-create-new-steem-blockchain-accounts-with-steemconnect ๋ฅผ ์ฐธ์กฐํ•˜๊ฑฐ๋‚˜, ์˜์–ด๊ฐ€ ์–ด๋ ต๊ฒŒ ๋А๊ปด์ง€์‹œ๋Š” ๋ถ„์€ ๋‚ด๊ฐ€ ์“ด ๋ฉ”๋‰ด์–ผ https://steemit.com/kr/@junn/391 ์˜ 4๋ฒˆ ํŒŒํŠธ๋ฅผ ์ฐธ์กฐํ•˜์—ฌ, App ์ „์šฉ ID๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“ค๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค.

App ID is same as my steemit ID. So if you want to use another ID for your App, it will be good to create new ID via steemconnect (example : https://steemit.com/news/@timcliff/new-tool-from-busy-org-create-new-steem-blockchain-accounts-with-steemconnect)

 

(1) Author

์†”์งํžˆ ์ž˜ ๋ชจ๋ฅด๊ฒ ๋‹ค, ๋‚ด ID์™€ ๋‹ค๋ฅธ ๋ฌธ๊ตฌ๋ฅผ ๋„ฃ์–ด๋ดค๋Š”๋ฐ, ์ง„ํ–‰์ƒ์—๋Š” ๋ฌธ์ œ๊ฐ€ ์—†๋‹ค.

I don’t know how ‘Author’ plays a role. I putย  text other than my ID(junn), there is no problem.

 

(2) Request Permission

App์„ ํ†ตํ•ด ๋กœ๊ทธ์ธ ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์—๊ฒŒ ์š”์ฒญํ•˜๋Š” ๊ถŒํ•œ์ด๋‹ค. ์ฆ‰ Post์— ์ฒดํฌ๋ฅผ ํ•ด๋†”์•ผ, ์ถ”ํ›„ ๋กœ๊ทธ์ธํ•œ ์‚ฌ์šฉ์ž๊ฐ€ App์„ ํ†ตํ•ด Steem์œผ๋กœ ํฌ์ŠคํŒ…์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ์˜๋ฏธ์ผ ๊ฒƒ์œผ๋กœ ํŒ๋‹จ๋œ๋‹ค.

Literally, request permission when users log in through this app. If you check ‘Post’, then user could ‘post’ their posting through your app.

 

(3) Allowed origin

๋กœ๊ทธ์ธ์ด ์š”์ฒญ๋˜๋Š” ๋„๋ฉ”์ธ์ด๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด ๋กœ๊ทธ์ธ ์š”์ฒญํŽ˜์ด์ง€๊ฐ€ http://junn.net/steem04.php ๋ผ๋ฉด, junn.net ๋„๋ฉ”์ธ์ด allowed origin์œผ๋กœ ๋“ฑ๋ก์ด ๋˜์–ด์•ผ ํ•œ๋‹ค.

You put origin domain in which request login. If you call login part from ‘http://junn.net/steem04.php’, ‘junn.net’ must be listed.

 

(4) Allowed redirect urls

๋กœ๊ทธ์ธ ํ›„์— redirection๋˜๋Š” ์ฃผ์†Œ์ด๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ƒ์—์„œ ์„ค์ •ํ•˜๊ฒŒ ๋˜๋Š”๋ฐ, ๊ทธ ์ฃผ์†Œ๊ฐ€ ์ •ํ™•ํžˆ ์ด url ๋ฆฌ์ŠคํŠธ์— ์žˆ์–ด์•ผ ํ•œ๋‹ค. http://junn.net/steem04.php์—์„œ ๋กœ๊ทธ์ธ์„ ์š”์ฒญํ–ˆ๊ณ , ์„ฑ๊ณต์‹œ http://junn.net/steem04_sub.php ์ด๋ผ๋Š” ๊ณณ์œผ๋กœ ์ด๋™ํ•œ๋‹ค๋ฉด, http://junn.net/steem04_sub.php ์ด ์ € ๋ฆฌ์ŠคํŠธ ์•ˆ์— ์žˆ์–ด์•ผ ํ•œ๋‹ค.

Redirection address will be set in javascript page, the exact address must be listed. If you want redirect to ‘http://junn.net/steem04_sub.php’ after login, ‘http://junn.net/steem04_sub.php’ should be listed.

์ด๋กœ์จ ์•ฑ ์„ธํŒ…์€ ์ข…๋ฃŒ.

https://pastebin.com/xJAs1tbc ๊ฐ€ ๊ธฐ์ž‘์„ฑ๋œ ์˜ˆ์ œ์ด๋‹ค (๋‚ด๊ฐ€ ๋งŒ๋“  ๊ฒƒ์ด ์•„๋‹˜). ๊ทธ๋ž˜์„œ ์ข€ ๋‹ค๋ฅธ ๋ฐฉ์‹์œผ๋กœ, ๋‹ค๋ฅธ OAuth ์•ฑ ์ฒ˜๋Ÿผ ์ƒˆ์ฐฝ์„ ๋„์›Œ์„œ ๋กœ๊ทธ์ธ์„ ์‹œ๋„ํ•˜๋Š” ์†Œ์Šค๋ฅผ ์ œ์ž‘ํ–ˆ๋‹ค.

https://pastebin.com/xJAs1tbc is an example that has already been made. But I approached in different way, in which open new window and try to login.

 

Test :

http://junn.net/steem04.php

Source:

https://github.com/junn279/steemjs_example/blob/master/steem04.php

https://github.com/junn279/steemjs_example/blob/master/steem04_sub.php

39์ค„์˜ ๋กœ๊ทธ์ธ์„ ๋ˆ„๋ฅด๋ฉด 33์ค„์˜ redirect function์ด ์‹คํ–‰๋˜๋ฉด์„œ ์ƒˆ์ฐฝ์ด ์—ด๋ฆฐ๋‹ค.

Click login (39th line), redirect function runs.(33th)

์ด ์ƒˆ ์ฐฝ์—๋Š” 20์ค„์—์„œ ๊ฐ€์ ธ์˜จ loginURL์ด ์—ด๋ฆฌ๋Š”๋ฐ, ์ด login URL์€ 15์ค„์˜ initialize ํ•จ์ˆ˜๋ฅผ ํ†ตํ•ด ๋ถˆ๋Ÿฌ์˜ค๊ฒŒ ๋œ๋‹ค. ์ด ํ•จ์ˆ˜๋ฅผ ์„ธํŒ…ํ•˜๋Š” 16,17์ค„์˜ ๋‚ด์šฉ์€ ์œ„์— ์„ค์ •ํ•œ App์˜ ์ •๋ณด์™€ ๋™์ผํ•ด์•ผํ•œ๋‹ค. 23-31์ค„์€ ๋กœ๊ทธ์ธ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ์— ์‹คํ–‰๋˜๋Š” ํ•จ์ˆ˜์ด๋‹ค.

New window load login page (loginURL;20th line), this url is loaded through initialize function(15th line). Initial variables are in 16th,17th line, must match to the information of the App which we’ve set above. 23-31st line will be executed when login is successful.

 

์•„๋ž˜ ์žˆ๋Š” steem04_sub.php์—์„œ๋Š” ๋กœ๊ทธ์ธ์ฐฝ์ด ์—ด๋ฆฐ๋˜์— ์ฝœ๋ฐฑ๋˜๋Š” ์ฃผ์†Œ์ธ๋ฐ,(์ฆ‰ ๋กœ๊ทธ์ธ์ด ์„ฑ๊ณตํ•˜๋ฉด ๋ฐ”๋€Œ๋Š”) ๋”ฐ๋ผ์„œ ๋กœ๊ทธ์ธ์ด ๋œ ์ดํ›„ 16-21์ค„์ด ์‹คํ–‰๋˜๋ฉฐ, ์ด ์ƒˆ๋กœ ๋œฌ ์ฐฝ์€ ๋‹ซํžˆ๊ณ , ์ด ์ฐฝ์„ ์—ฐ(steem04.php)๋ฅผย  reload ํ•จ์œผ๋กœ์„œ steem04.php์˜ 23-31 ์ค„์ด ์‹คํ–‰๋˜๊ฒŒ ๋˜๋Š” ๊ฒƒ์ด๋‹ค.

steem04_sub.php is redirect page which is loaded after successful login, 16th-21st line is run after login. So this page will be closed, refresh opener page(steem04.php). And then we can run 23rd-31st line of steem04.php.

๋กœ๊ทธ์ธ์ด ์™„๋ฃŒ๋˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋ฐ”๋€Œ๋ฉด์„œ

After login, we can see as below,

์ฝ˜์†”์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋œฌ๋‹ค.

We can get the information of user from console.

์ด ๋‹ค์Œ์—” ์•„๋งˆ userId ๋ฐ token์„ ์ด์šฉํ•ด์„œ Post, vote, follow ๋“ฑ์„ ํ•˜๋Š” ๊ณผ์ •์ผ ๊ฒƒ์ด๋‹ค.

May next work is Posting, voting, following using this userID and token.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Like this:

Like Loading...

Related

  • Tags:
  • login
  • outside
  • Steem
  • steemconnect
0 Shares:
Share 0
Tweet 0
Pin it 0
J Seok

์Œ์•…, ๋ฏธ์ˆ , ์ปดํ“จํ„ฐ๋ฅผ ์ข‹์•„ํ•˜๋Š” ์„œ์šธ๋Œ€ํ•™๊ต๋ณ‘์› ์ด๋น„์ธํ›„๊ณผ-๋‘๊ฒฝ๋ถ€์™ธ๊ณผ ์ „๋ฌธ์˜์ž…๋‹ˆ๋‹ค. Curriculum Vitae - https://jseok.md

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

โ€” Previous article

Python Lambda expression in For Loop

Next article โ€”

Idioma : Hablar por los codos

Top Posts
  • ๋‚˜๋งŒ์˜ LPํŒ์„ ๋งŒ๋“ค์–ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค (Vinylify.com ์ด์šฉ ํ›„๊ธฐ)
    ๋‚˜๋งŒ์˜ LPํŒ์„ ๋งŒ๋“ค์–ด ๋ณด์•˜์Šต๋‹ˆ๋‹ค (Vinylify.com ์ด์šฉ ํ›„๊ธฐ)
  • ์ด๋น„์ธํ›„๊ณผ ์˜์‚ฌ๊ฐ€ ์Šค์ฟ ๋ฒ„๋‹ค์ด๋น™ ํ›„์— ์ค‘์ด์—ผ ๊ฑธ๋ฆฐ ์ด์•ผ๊ธฐ (์••์ฐฉ, ์—ญ์••์ฐฉ, ์••๋ ฅํ‰ํ˜•)
    ์ด๋น„์ธํ›„๊ณผ ์˜์‚ฌ๊ฐ€ ์Šค์ฟ ๋ฒ„๋‹ค์ด๋น™ ํ›„์— ์ค‘์ด์—ผ ๊ฑธ๋ฆฐ ์ด์•ผ๊ธฐ (์••์ฐฉ, ์—ญ์••์ฐฉ, ์••๋ ฅํ‰ํ˜•)
  • ๊ตฌ๊ฐ•, ๊ตฌ์ธ๋‘ ์‚ฌ๋งˆ๊ท€ (oral, pharyngeal squamous papilloma)
    ๊ตฌ๊ฐ•, ๊ตฌ์ธ๋‘ ์‚ฌ๋งˆ๊ท€ (oral, pharyngeal squamous papilloma)
  • [Python] CNN10 ์—์„œ ํŠน์ • ๋‚ด์šฉ์ด ํฌํ•จ๋œ Script ์ฐพ๊ธฐ (Crawling, ํฌ๋กค๋ง ์˜ˆ์ œ)
    [Python] CNN10 ์—์„œ ํŠน์ • ๋‚ด์šฉ์ด ํฌํ•จ๋œ Script ์ฐพ๊ธฐ (Crawling, ํฌ๋กค๋ง ์˜ˆ์ œ)
  • ์˜ค๋ ˆ์˜ค ๋ Œ์ฆˆ + x-T30
    ์˜ค๋ ˆ์˜ค ๋ Œ์ฆˆ + x-T30
Recent Posts
  • ๐Ÿ’Š๐Ÿ’Š Medicine
    ๊ฐ‘์ƒ์„  ๊ณ ์ฃผํŒŒ์ˆ˜์ˆ (RFA) ํ›„ ์ถ”์ ๊ด€์ฐฐ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
    • April 12, 2025
  • โœโœ๏ธ Monolog
    ์˜ค๋ ˆ์˜ค ๋ Œ์ฆˆ + x-T30
    • March 13, 2025
  • โœโœ๏ธ Monolog
    ๋ฆฌ๋””๋ถ์Šค ํŽ˜์ดํผ 1์„ธ๋Œ€ ์‚ฌ์šฉ๊ธฐ
    • March 8, 2025
Categories
  • โœ๏ธ Monolog (40)
  • ๐ŸŽจ Art & Culture (39)
    • Thing I Painted (13)
  • ๐ŸŽท Jazz & Classic (39)
  • ๐Ÿ“ Language (14)
  • ๐Ÿ’Š Medicine (43)
  • ๐Ÿ’ป Programming (113)
    • Things I Created (5)
  • ๐Ÿงฎ R Statistics (9)
  • ๐Ÿงญ Travelog (114)
  • ๐Ÿ—ฃ๏ธ Voice & Phonetics (11)
Archives
Blog Stats
  • 216,876 hits
junn.net
Designed & Developed by Code Supply Co.
 

Loading Comments...
 

    %d