oauth

Telegram bot - OAuth authorization

隐身守侯 提交于 2020-05-24 21:27:45
问题 I want to implement OAuth authorization by Twitch API on my bot, and when I was looking for a better solution, I found this @GitHubBot. In this bot redirect URL starting for integrations.telegram.org/github, and I wonder how to implement auth like this. If you please, can you tell best practice to implement OAuth in telegram bots? What the better case: Authorization Code or Implicit Grant? Thank you in advance! 回答1: I had the same idea of authorizing access to 3rd party services via Telegram

Telegram bot - OAuth authorization

不羁岁月 提交于 2020-05-24 21:27:10
问题 I want to implement OAuth authorization by Twitch API on my bot, and when I was looking for a better solution, I found this @GitHubBot. In this bot redirect URL starting for integrations.telegram.org/github, and I wonder how to implement auth like this. If you please, can you tell best practice to implement OAuth in telegram bots? What the better case: Authorization Code or Implicit Grant? Thank you in advance! 回答1: I had the same idea of authorizing access to 3rd party services via Telegram

How to parse URL # fragments with query items in Swift

人走茶凉 提交于 2020-05-16 03:07:45
问题 Query parameters sometimes get passed as URL fragments instead of query parameters - e.g. during OAuth flows to provide client-only access to parameters. What's the simplest way to parse a URL like: https://example.com/auth-callback#access_token=mytoken&expires_in=36000&scope=zap+profile into key values for: access_token, expires_in, scope 回答1: Simply pass the fragment property as a query string to a new URLComponent and read the parsed query objects: let url = URL(string: "https://example

How to parse URL # fragments with query items in Swift

谁说我不能喝 提交于 2020-05-16 03:07:35
问题 Query parameters sometimes get passed as URL fragments instead of query parameters - e.g. during OAuth flows to provide client-only access to parameters. What's the simplest way to parse a URL like: https://example.com/auth-callback#access_token=mytoken&expires_in=36000&scope=zap+profile into key values for: access_token, expires_in, scope 回答1: Simply pass the fragment property as a query string to a new URLComponent and read the parsed query objects: let url = URL(string: "https://example

Should I use OAuth (or what else) for the backend of a mobile app? - There is only *one* “third-party” application in such cases

十年热恋 提交于 2020-05-15 18:06:10
问题 I am developing a mobile app and its backend (Java). How shall I authenticate the users (using our own account system, not things like Google/GitHub accounts)? One way is to create an OAuth2 server. However, my backend is not a giant, and I only have one "third-party application" in the definition of OAuth... So I wonder what is the best way of authentication in such an mobile app? Thanks! P.S. Another idea is to use cookies, just like the old days when developing browser webpages. But I

Should I use OAuth (or what else) for the backend of a mobile app? - There is only *one* “third-party” application in such cases

大憨熊 提交于 2020-05-15 18:05:54
问题 I am developing a mobile app and its backend (Java). How shall I authenticate the users (using our own account system, not things like Google/GitHub accounts)? One way is to create an OAuth2 server. However, my backend is not a giant, and I only have one "third-party application" in the definition of OAuth... So I wonder what is the best way of authentication in such an mobile app? Thanks! P.S. Another idea is to use cookies, just like the old days when developing browser webpages. But I

Should I use OAuth (or what else) for the backend of a mobile app? - There is only *one* “third-party” application in such cases

大兔子大兔子 提交于 2020-05-15 18:05:09
问题 I am developing a mobile app and its backend (Java). How shall I authenticate the users (using our own account system, not things like Google/GitHub accounts)? One way is to create an OAuth2 server. However, my backend is not a giant, and I only have one "third-party application" in the definition of OAuth... So I wonder what is the best way of authentication in such an mobile app? Thanks! P.S. Another idea is to use cookies, just like the old days when developing browser webpages. But I

OAuth2 without Client Secret – Possible Phishing?

眉间皱痕 提交于 2020-05-15 09:43:09
问题 I've been reading the OAuth2 specs over and over, but I can't figure out one thing. Isn't the Authorization Code flow without Client Secret (which is now recommended for single page apps) highly insecure because it can easily be used for phishing? Let me explain: The Client redirects the Resource Owner to the Authorization Server, passing the Redirect URL and Client ID. The Resource Owner approves the request and the Authorization Server redirects him to the given Redirect URL and passes the

How can I authorize Google Speech-to-text from Google Apps script?

折月煮酒 提交于 2020-05-14 08:48:09
问题 I'm trying to execute google-speech-to-text from apps script. Unfortunately, I cannot find any examples for apps script or pure HTTP, so I can run it using simple UrlFetchApp. I created a service account and setup a project with enabled speech-to-text api, and was able to successfully run recognition using command-line example curl -s -H "Content-Type: application/json" \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ https://speech.googleapis.com/v1/speech

How can I authorize Google Speech-to-text from Google Apps script?

早过忘川 提交于 2020-05-14 08:47:32
问题 I'm trying to execute google-speech-to-text from apps script. Unfortunately, I cannot find any examples for apps script or pure HTTP, so I can run it using simple UrlFetchApp. I created a service account and setup a project with enabled speech-to-text api, and was able to successfully run recognition using command-line example curl -s -H "Content-Type: application/json" \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ https://speech.googleapis.com/v1/speech