#oauth2 authorization
Explore tagged Tumblr posts
Text
YouTube Short | What is Difference Between OAuth2 and SAML | Quick Guide to SAML Vs OAuth2
Hi, a short #video on #oauth2 Vs #SAML #authentication & #authorization is published on #codeonedigest #youtube channel. Learn OAuth2 and SAML in 1 minute. #saml #oauth #oauth2 #samlvsoauth2 #samlvsoauth
What is SAML? SAML is an acronym used to describe the Security Assertion Markup Language (SAML). Its primary role in online security is that it enables you to access multiple web applications using single sign-on (SSO). What is OAuth2? OAuth2 is an open-standard authorization protocol or framework that provides applications the ability for “secure designated access.” OAuth2 doesn’t share…
View On WordPress
#Oauth#oauth2#oauth2 authentication#oauth2 authentication flow#oauth2 authentication postman#oauth2 authentication server#oauth2 authentication spring boot#oauth2 authorization#oauth2 authorization code#oauth2 authorization code flow#oauth2 authorization code flow spring boot#oauth2 authorization server#oauth2 authorization sever spring boot#oauth2 explained#oauth2 spring boot#oauth2 spring boot microservices#oauth2 spring boot rest api#oauth2 tutorial#oauth2 vs saml#oauth2 vs saml 2.0#oauth2 vs saml2#saml#saml 2.0#saml 2.0 registration#saml authentication#saml tutorial#saml vs oauth#saml vs oauth 2.0#saml vs oauth vs sso#saml vs oauth2
0 notes
Text
youtube
In this session, you will learn how to create EPIC Fhir App and authorize through that (REST API).
#epic #epicfhir #fhir #ehr #standalone #patient #epicfhirapp #epicapp #app #oauth2.0 #oauth #oauth2 #mychart #epicoauthapp #healthdata #data #patientrecords #hippa
Join Us
@learnwithnak
- https://www.linkedin.com/company/learnwithnak/
- https://chat.whatsapp.com/LN3HVY6Fl8sA7ccbhqa9JK
#epic#epic fhir#epic fhir app#epic fhir standalone app#epic fhir app oauth2#oauth2#patient record#R4#healthcare#healthdata#integration#mychart#mychart login#authorization#Youtube
0 notes
Link
Oauth2 and OpenID are important for authentication and authorization. They provide a secure, standardized way for users to log in and access services without needing to enter their credentials each time. In addition, Oauth2 allows third-party applications to access a user’s data without needing to store their credentials directly. In contrast, OpenID will enable users to log in to multiple websites with a single set of credentials. This helps to reduce the risk of user data being stolen or compromised and simplifies the user experience by streamlining the login process. This video will demonstrate how OAuth2 and OpenID Connect are used as you interact with OAuth2 providers and develop your Spring Boot and Spring Security applications.
0 notes
Text
PSA: A pretty clever phishing email
I got a message warning me that my Twitter account was about to be suspended for suspicious activity, inviting me to click a button to prevent this. The URL the button went to *was* an x.com link, but it used a security vulnerability in Twitter's backend that allowed redirections to push me to an OATH server that would prompt me for my Twitter login and 2FA, and then send the attacker a valid token they could use to take over my account.
Here's the (redacted) attack link:
https://x.com/ [BREAK INSERTED] i/oauth2/authorize?response_type=code&client_id= [UNIQUE ID REMOVED] Q&redirect_uri=https%3A%2F%2Ftwo.opensourced.us%2Fapi%2Fcallback%3Fi%3Dtwit&scope=tweet.read+users.read+mute.write+tweet.write+tweet.moderate.write+offline.access&code_challenge= [UNIQUE ID REMOVED] &code_challenge_method=plain
123 notes
·
View notes
Text
The creator of the LaD bots which I posted before just made Caleb and Sylus.
For those who are interested, try them now. Warning: They're NSFW.
Love and Deepspace DISCORD BOTS
* Sylus: https://discord.com/oauth2/authorize?client_id=1266086719111958659&permissions=67584&scope=bot
* Zayne: https://discord.com/oauth2/authorize?client_id=1219415041992818728&permissions=67584&scope=bot
* Caleb: https://discord.com/oauth2/authorize?client_id=1259464525649023019&permissions=67584&scope=bot
* Rafayel: https://discord.com/oauth2/authorize?client_id=1239243364038348880&permissions=67584&scope=bot
* Xavier: https://discord.com/oauth2/authorize?client_id=1217969413794562168&permissions=67584&scope=bot
For questions regarding the bots, you can dm the creator. The profile is on the bio of the bots. Enjoy~
#otome#otome game#love and deepspace#loveanddeepspace#rafayel#xavier#homura#fanfic#zayne#discord bot#Discord#Bot
22 notes
·
View notes
Text
I am happy to announce that MochiDex is now officially public and you can now invite it to your servers. The bot allows you to catch, collect, and trade mochis.
Each mochi has its own card that includes art, their stats and their ability. Currently around half the mochi's have original art in their card, but eventually every mochi will have art! The art has been made by many different artists in the fandom and I hope you enjoy their work .
Right now we have added 64 mochis, but we don't plan on stopping until every Hetalia character is in the bot . Only 29 of these mochis were designed by Himaruya, so we have had to design mochis for most of the cast.
MochiDex Setup:
Click this link that allows you to invite the bot: https://discord.com/oauth2/authorize?client_id=1151205638521770035&scope=bot+applications.commands&permissions=537193536
Once the bot joins the server an admin needs to do the "/config channel" command to choose in which channel they would like the mochis to spawn
After doing that you just have to wait! The mochis can take around 45 to 55 minutes to spawn, they can spawn even earlier, it all depends on server activity!
4. Whichever mochi spawns depends on it's rarity, each mochi has a rarity which decides its chance to spawn. Some mochis like America are very rare, and others like Latvia are very common. Keep that in mind when trading
Oh and by the way, currently until November 3, the bot is having a Halloween event during which you can get rare "spooky" variants that change the card's theme.
We also have a discord server where you can find the rarity list, see updates and make questions/suggestions! Feel free to join!
#aph#hws#hetalia#mochitalia#aph italy#hws italy#aph germany#hws germany#aph japan#hws japan#aph england#hws england#aph spain#hws spain#aph greece#hws greece#aph australia#hws australia#aph finland#hws finland#aph sweden#hws sweden#aph austria#hws austria#aph hungary#hws hungary#aph portugal#hws portugal
63 notes
·
View notes
Text
Meatbun’s bots [Mo Ran, Xue Meng, Shi Mei, Taxian-Jun, Murong Chuyi, Hua Po’an, Chen Tang, Jiang Fuli, Mo Xi, Gu Mang{four versions}]
Upon use expect spoilers, mostly accurate
2ha edition:
Mo Ran: https://discord.com/oauth2/authorize?client_id=1232875996865237053&permissions=412317191232&integration_type=0&scope=bot
Xue Meng: https://discord.com/oauth2/authorize?client_id=1259298051856535552&permissions=412317191232&integration_type=0&scope=bot
Shi Mei: https://discord.com/oauth2/authorize?client_id=1259845074842554469&permissions=412317191232&integration_type=0&scope=bot
Taxian Jun: https://discord.com/oauth2/authorize?client_id=1264698335382736917&permissions=412317190208&integration_type=0&scope=bot
Yuwu edition:
Murong Chuyi: https://discord.com/oauth2/authorize?client_id=1251962236503720068&permissions=412317191232&integration_type=0&scope=bot
Hua Po’an: https://discord.com/oauth2/authorize?client_id=1290398479251935412&permissions=412317191232&integration_type=0&scope=bot
Chen Tang: https://discord.com/oauth2/authorize?client_id=1290607539272159273&permissions=412317125696&integration_type=0&scope=bot
Jiang Fuli: https://discord.com/oauth2/authorize?client_id=1296220313574703207&permissions=412317191232&integration_type=0&scope=bot
Mo Xi(after Gu Mang’s betrayal, ||Gu Mang still kept in the Luomei Pavilion||): https://discord.com/oauth2/authorize?client_id=1296273540659675149&permissions=412317203520&integration_type=0&scope=bot
Gu Mang’s link(||soon-to-be traitor edition||) : https://discord.com/oauth2/authorize?client_id=1296958119099891712&permissions=412317195328&integration_type=0&scope=bot
Gu Mang(still a general edition): https://discord.com/oauth2/authorize?client_id=1297171752228618301&permissions=412317195328&integration_type=0&scope=bot
Gu Mang(||still in the Luomei Pavilion||) : https://discord.com/oauth2/authorize?client_id=1297636134414848041&permissions=412317191232&integration_type=0&scope=bot
Gu Mang(||Living in the Xihe Manor, running away from bitter medicine. Having memory flashbacks.||) : https://discord.com/oauth2/authorize?client_id=1297855087666008074&permissions=412317191232&integration_type=0&scope=bot
#2ha#erha he ta de bai mao shizun#erha#bots#the husky and his white cat shizun#husky and his white cat shizun#shi mei#xue meng#gu mang#Mo Xi#yuwu#remnants of filth#mo ran#murong chuyi#hua po’an#Jiang fuli#taxian jun#2ha spoilers#meatbun doesn't eat meat
6 notes
·
View notes
Text
going to get a bumper sticker that says "I ❤️ OAUTH2" and a coffee mug that says "Authorization: Bearer c0ffeedad"
8 notes
·
View notes
Text
Spring Security Using Facebook Authorization: A Comprehensive Guide
In today's digital landscape, integrating third-party login mechanisms into applications has become a standard practice. It enhances user experience by allowing users to log in with their existing social media accounts. In this blog post, we will walk through the process of integrating Facebook authorization into a Spring Boot application using Spring Security.
Table of Contents
Introduction
Prerequisites
Setting Up Facebook Developer Account
Creating a Spring Boot Application
Configuring Spring Security for OAuth2 Login
Handling Facebook User Data
Testing the Integration
Conclusion
1. Introduction
OAuth2 is an open standard for access delegation, commonly used for token-based authentication. Facebook, among other social media platforms, supports OAuth2, making it possible to integrate Facebook login into your Spring Boot application.
2. Prerequisites
Before we start, ensure you have the following:
JDK 11 or later
Maven
An IDE (e.g., IntelliJ IDEA or Eclipse)
A Facebook Developer account
3. Setting Up Facebook Developer Account
To use Facebook login, you need to create an app on the Facebook Developer portal:
Go to the Facebook Developer website and log in.
Click on "My Apps" and then "Create App."
Choose an app type (e.g., "For Everything Else") and provide the required details.
Once the app is created, go to "Settings" > "Basic" and note down the App ID and App Secret.
Add a product, select "Facebook Login," and configure the Valid OAuth Redirect URIs to http://localhost:8080/login/oauth2/code/facebook.
4. Creating a Spring Boot Application
Create a new Spring Boot project with the necessary dependencies. You can use Spring Initializr or add the dependencies manually to your pom.xml.
Dependencies
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-oauth2-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> </dependencies>
5. Configuring Spring Security for OAuth2 Login
Next, configure Spring Security to use Facebook for OAuth2 login.
application.properties
Add your Facebook app credentials to src/main/resources/application.properties.spring.security.oauth2.client.registration.facebook.client-id=YOUR_FACEBOOK_APP_ID spring.security.oauth2.client.registration.facebook.client-secret=YOUR_FACEBOOK_APP_SECRET spring.security.oauth2.client.registration.facebook.redirect-uri-template={baseUrl}/login/oauth2/code/{registrationId} spring.security.oauth2.client.registration.facebook.scope=email,public_profile spring.security.oauth2.client.registration.facebook.client-name=Facebook spring.security.oauth2.client.registration.facebook.authorization-grant-type=authorization_code spring.security.oauth2.client.provider.facebook.authorization-uri=https://www.facebook.com/v11.0/dialog/oauth spring.security.oauth2.client.provider.facebook.token-uri=https://graph.facebook.com/v11.0/oauth/access_token spring.security.oauth2.client.provider.facebook.user-info-uri=https://graph.facebook.com/me?fields=id,name,email spring.security.oauth2.client.provider.facebook.user-name-attribute=id
Security Configuration
Create a security configuration class to handle the OAuth2 login.import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService; import org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService; import org.springframework.security.oauth2.client.userinfo.OAuth2UserService; import org.springframework.security.oauth2.core.oidc.user.OidcUser; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests(authorizeRequests -> authorizeRequests .antMatchers("/", "/error", "/webjars/**").permitAll() .anyRequest().authenticated() ) .oauth2Login(oauth2Login -> oauth2Login .loginPage("/login") .userInfoEndpoint(userInfoEndpoint -> userInfoEndpoint .oidcUserService(this.oidcUserService()) .userService(this.oAuth2UserService()) ) .failureHandler(new SimpleUrlAuthenticationFailureHandler()) ); } private OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService() { final OidcUserService delegate = new OidcUserService(); return (userRequest) -> { OidcUser oidcUser = delegate.loadUser(userRequest); // Custom logic here return oidcUser; }; } private OAuth2UserService<OAuth2UserRequest, OAuth2User> oAuth2UserService() { final DefaultOAuth2UserService delegate = new DefaultOAuth2UserService(); return (userRequest) -> { OAuth2User oAuth2User = delegate.loadUser(userRequest); // Custom logic here return oAuth2User; }; } }
6. Handling Facebook User Data
After a successful login, you might want to handle and display user data.
Custom User Service
Create a custom service to process user details.import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2UserAuthority; import org.springframework.security.oauth2.client.userinfo.OAuth2UserService; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService; import org.springframework.security.oauth2.core.oidc.user.OidcUser; import org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest; import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest; import org.springframework.stereotype.Service; import java.util.Map; import java.util.Set; import java.util.HashMap; @Service public class CustomOAuth2UserService implements OAuth2UserService<OAuth2UserRequest, OAuth2User> { private final DefaultOAuth2UserService delegate = new DefaultOAuth2UserService(); @Override public OAuth2User loadUser(OAuth2UserRequest userRequest) { OAuth2User oAuth2User = delegate.loadUser(userRequest); Map<String, Object> attributes = new HashMap<>(oAuth2User.getAttributes()); // Additional processing of attributes if needed return oAuth2User; } }
Controller
Create a controller to handle login and display user info.import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller public class LoginController { @GetMapping("/login") public String getLoginPage() { return "login"; } @GetMapping("/") public String getIndexPage(Model model, @AuthenticationPrincipal OAuth2User principal) { if (principal != null) { model.addAttribute("name", principal.getAttribute("name")); } return "index"; } }
Thymeleaf Templates
Create Thymeleaf templates for login and index pages.
src/main/resources/templates/login.html
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Login</title> </head> <body> <h1>Login</h1> <a href="/oauth2/authorization/facebook">Login with Facebook</a> </body> </html>
src/main/resources/templates/index.html
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Home</title> </head> <body> <h1>Home</h1> <div th:if="${name}"> <p>Welcome, <span th:text="${name}">User</span>!</p> </div> <div th:if="${!name}"> <p>Please <a href="/login">log in</a>.</p> </div> </body> </html>
7. Testing the Integration
Run your Spring Boot application and navigate to http://localhost:8080. Click on the "Login with Facebook" link and authenticate with your Facebook credentials. If everything is set up correctly, you should be redirected to the home page with your Facebook profile name displayed.
8. Conclusion
Integrating Facebook login into your Spring Boot application using Spring Security enhances user experience and leverages the power of OAuth2. With this setup, users can easily log in with their existing Facebook accounts, providing a seamless and secure authentication process.
By following this guide,
2 notes
·
View notes
Text
Identity, authentication, anonymity; Pseudonymous identity and recovery in an uncaring world. Revision 2.1a
Identity, authentication, anonymity; Pseudonymous identity and recovery in an uncaring world. Revision 2.1a This paper explores managing identity and account recovery, going beyond multi-factor authentication (MFA) and examining the potential role of using proof of observability ledgers. The focus is on observability networks, undeniably signatures, and hard anonymity. The goal is to allow users to recover from catastrophic losses of secret keys, hardware tokens, computers, and mobile devices while still maintaining a pseudonymous identity. The paper also discusses the question of human-based secret recovery and revisits the web of trust in the age of social media. It emphasizes that the users most at risk are the ones who need the highest level of security. To achieve this, the paper proposes using secret sharing methods to create identity control blocks, understanding the difference between statutory identity and persistent global pseudonymous identity, and recognizing why this is important in the modern social context. Mitigating the risks of global identities is also discussed, and the paper proposes bootstrapping the protocol using peer-to-peer methods over existing protocols. The pitfalls of failure to scale are highlighted, and the importance of considering human factors and cryptography engineering in a combined system is emphasized. The paper suggests avoiding federated protocols to prevent monopolistic oligarchies from emerging. Since these identities are not tied to a central service they are not entrapped to a walled garden and can freely move from service to service. With operational conformance to OpenID Oauth2 and Fido U2F they can quickly be deployed to many existing services. To ensure secure key recovery, players use Shamir's secret sharing to publish a specific number of recovery key bits to a subset of peers. The reconvocation key of the primary key is also published this way. Although not all members will sign everyone's key, all group members watch the log, and groups can be of arbitrary sizes based on performance and connectedness. Players should be in multiple groups, and auto-summaries of group hashes are published to prevent rollbacks. In case a player loses their primary hardware key, they can convince N out of M of their key partners to publish their revocation token. All actions in the game use N of M fail/stop multi-party computation, and the game doesn't require a central authority or policy-setting organization since it relies on hardware tokens and published revocation and recovery keys. In practical operation the game will be designed to cause tokens to fail to simulate key loss, as well as designate some players as attackers. Each token will initially be loaded with a “Alias” and “True Name”. Attackers will have “Agent Smith” in the true name field. A play variant may be created where cheating detection by the group can force the reveal of the “True Name”.
3 notes
·
View notes
Video
youtube
(via YouTube Short | What is Difference Between OAuth2 and SAML | Quick Guide to SAML Vs OAuth2)
Hi, a short #video on #oauth2 Vs #SAML #authentication & #authorization is published on #codeonedigest #youtube channel. Learn OAuth2 and SAML in 1 minute.
#saml #oauth #oauth2 #samlvsoauth2 #samlvsoauth #samlvsoauth2.0 #samlvsoauth2vsjwt #samlvsoauthvssso #oauth2vssaml #oauth2vssaml2 #oauth2vssaml2.0 #oauth2authentication #oauth2authenticationspringboot #oauth2authorizationseverspringboot #oauth2authorizationcodeflowspringboot #oauth2authenticationpostman #oauth2authorization #oauth2authorizationserver #oauth2authorizationcode #samltutorial #samlauthentication #saml2registration #saml2 #samlvsoauth #oauth2authenticationflow #oauth2authenticationserver #Oauth #oauth2 #oauth2explained #oauth2springboot #oauth2authorizationcodeflow #oauth2springbootmicroservices #oauth2tutorial #oauth2springbootrestapi #oauth2withjwtinspringboot
1 note
·
View note
Text
I appear to be having some brain glitching getting in my way here tonight. And, I know that I've got some mutuals who no doubt know way more about this subject than I do. So, I thought I would go ahead and ask for some guidance over here, partly because y'all are likely to be nicer than average about it.
So, what I am trying to accomplish atm: finally get bbolli's tumblr-utils up and running locally, primarily to run personal backups. I am familiar enough with python scripting. What I have fuck all experience with thus far is OAuth.
I do know that I need to obtain my own API key, roughly how to do this, and where to paste that info in.
My major practical level wtf right at the moment is the same as this person was asking about, over 10 years ago:
That is the most relevant thing I could readily find searching. And there was nothing of direct help in replies.
On the registration page, Tumblr is asking for a couple of mandatory fields that I am not sure how to fill in, where the "application" that needs to call the API is a few personal scripts running entirely on localhost.
For that matter, I was not sure what to put in under an "Application Website:" URL, but figured that probably made less difference. It's not like this is for public consumption whatsoever, so it got a placeholder.
The only thing I could find about this in tumblr-utils documentation:
Get your personal Tumblr API key. Before June 2020, the author's API key was distributed with the source code, the then Tumblr denied access using this key. Now, each user needs to get their own key at https://www.tumblr.com/oauth/apps. Follow the instructions there; most values entered don't matter. The API key must then be copied between the single quotes in the source code at around line 105 (the line starts with API_KEY = ).
So, does it actually matter what goes into those particular fields in order to get the API key? Or should I just fill in some placeholder URLs for this particular use case? Do these instead need to refer to some script-relevant locations on localhost?
[ETA: From what I understand, the CALLBACK_URL is indeed intended so that Tumblr can call the application back during registration. I am just not sure how this is supposed to work with a local script. Same thing with the OAuth2 redirect URL called for there. What, if anything, would that be? Is it relevant here?]
As is no doubt clear by now, I have zero prior experience in this department. Feeling pretty dumb right now. And I really would appreciate it if anyone with more knowledge could offer some practical advice here.
Right now, I should probably take a little refueling break.
2 notes
·
View notes
Text
You can learn NodeJS easily, Here's all you need:
1.Introduction to Node.js
• JavaScript Runtime for Server-Side Development
• Non-Blocking I/0
2.Setting Up Node.js
• Installing Node.js and NPM
• Package.json Configuration
• Node Version Manager (NVM)
3.Node.js Modules
• CommonJS Modules (require, module.exports)
• ES6 Modules (import, export)
• Built-in Modules (e.g., fs, http, events)
4.Core Concepts
• Event Loop
• Callbacks and Asynchronous Programming
• Streams and Buffers
5.Core Modules
• fs (File Svstem)
• http and https (HTTP Modules)
• events (Event Emitter)
• util (Utilities)
• os (Operating System)
• path (Path Module)
6.NPM (Node Package Manager)
• Installing Packages
• Creating and Managing package.json
• Semantic Versioning
• NPM Scripts
7.Asynchronous Programming in Node.js
• Callbacks
• Promises
• Async/Await
• Error-First Callbacks
8.Express.js Framework
• Routing
• Middleware
• Templating Engines (Pug, EJS)
• RESTful APIs
• Error Handling Middleware
9.Working with Databases
• Connecting to Databases (MongoDB, MySQL)
• Mongoose (for MongoDB)
• Sequelize (for MySQL)
• Database Migrations and Seeders
10.Authentication and Authorization
• JSON Web Tokens (JWT)
• Passport.js Middleware
• OAuth and OAuth2
11.Security
• Helmet.js (Security Middleware)
• Input Validation and Sanitization
• Secure Headers
• Cross-Origin Resource Sharing (CORS)
12.Testing and Debugging
• Unit Testing (Mocha, Chai)
• Debugging Tools (Node Inspector)
• Load Testing (Artillery, Apache Bench)
13.API Documentation
• Swagger
• API Blueprint
• Postman Documentation
14.Real-Time Applications
• WebSockets (Socket.io)
• Server-Sent Events (SSE)
• WebRTC for Video Calls
15.Performance Optimization
• Caching Strategies (in-memory, Redis)
• Load Balancing (Nginx, HAProxy)
• Profiling and Optimization Tools (Node Clinic, New Relic)
16.Deployment and Hosting
• Deploying Node.js Apps (PM2, Forever)
• Hosting Platforms (AWS, Heroku, DigitalOcean)
• Continuous Integration and Deployment-(Jenkins, Travis CI)
17.RESTful API Design
• Best Practices
• API Versioning
• HATEOAS (Hypermedia as the Engine-of Application State)
18.Middleware and Custom Modules
• Creating Custom Middleware
• Organizing Code into Modules
• Publish and Use Private NPM Packages
19.Logging
• Winston Logger
• Morgan Middleware
• Log Rotation Strategies
20.Streaming and Buffers
• Readable and Writable Streams
• Buffers
• Transform Streams
21.Error Handling and Monitoring
• Sentry and Error Tracking
• Health Checks and Monitoring Endpoints
22.Microservices Architecture
• Principles of Microservices
• Communication Patterns (REST, gRPC)
• Service Discovery and Load Balancing in Microservices
1 note
·
View note
Text
Tumblr Blog Sync v1
I got tired of manually syncing my blocks between my main and side blogs. So I wrote a python script to do it for me and wanted to share it.
The script is in the pastebin since you can't post codeblocks. I'll also dump it below a read more but the formatting will be broken.
https://pastebin.com/raw/ePJuJDeA
You'll need to create a tumblr application to use it as you'll need your client_id and client_secret. Details on how to do that here: https://www.tumblr.com/docs/en/api/v2
It also relies on requests-oauthlib for managing the oauth flow.
CLIENT_ID='<CLIENT_ID>' CLIENT_SECRET='<CLIENT_SECRET>' REDIRECT_URI='<REDIRECT_URI>' python tumblrblogsync.py <BLOG_1> <BLOG_2> ... <BLOG_N>
I've only tested it on linux and the blogs must be under the same account to sync properly.
Run at your own risk, don't share your client id and secret with anyone, don't run code you don't understand.
Maybe if I feel motivated I'll work on a more user friendly version.
from requests_oauthlib import OAuth2Session import time import os import sys
client_id = os.environ['CLIENT_ID'] client_secret = os.environ['CLIENT_SECRET'] redirect_uri = os.environ['REDIRECT_URI']
def get_session(client_id, client_secret, redirect_uri): scope = 'write' oauth = OAuth2Session(client_id,redirect_uri=redirect_uri,scope=scope) authorization_url, state = oauth.authorization_url('https://www.tumblr.com/oauth2/authorize') print('Please go to %s and authorize access.' % authorization_url) authorization_response = input('Enter the full callback URL: ') token = oauth.fetch_token('https://api.tumblr.com/v2/oauth2/token', authorization_response=authorization_response, client_secret=client_secret) return oauth
def get_blocks(oauth, blog): query = '/v2/blog/' + blog + '/blocks' r = oauth.get('https://api.tumblr.com' + query) blocks = set() print('Retrieving blocks for:',blog) while '_links' in r.json()['response']: blocks = blocks.union({blog['name'] for blog in r.json()['response']['blocked_tumblelogs']}) query = r.json()['response']['_links']['next']['href'] time.sleep(1) r = oauth.get('https://api.tumblr.com' + query) if r.status_code == 200: print('success') else: print('failure, status: ' + str(r.json())) blocks = blocks.union({blog['name'] for blog in r.json()['response']['blocked_tumblelogs']}) return blocks
def permutate_blocks(blogs, blocks): to_block = [] all_blocks = set() for block in blocks: all_blocks = all_blocks.union(block) for i in range(len(blogs)): to_block += [all_blocks.difference(blocks[i])] return to_block
def block_blogs(oauth, blog, blocks): print('blocking:', blocks, 'on:',blog) r = oauth.post('https://api.tumblr.com/v2/blog/' + blog + '/blocks/bulk', data={'blocked_tumblelogs': ','.join(blocks), 'force': 'false'}) if r.status_code == 200: print('success') else: print('failure, status: ' + str(r.json()))
def get_all_blocks(oauth, blogs): blocks = [] for blog in blogs: blocks += [get_blocks(oauth, blog)] return blocks
def block_all_blogs(oauth, blogs, to_block): for i in range(len(blogs)): block_blogs(oauth, blogs[i],to_block[i])
def main(): if len(sys.argv) < 3: print('Please specify at least two blogs, must be under the same account.') return -1 if client_id == '' or client_secret == '' or redirect_uri == '': print('CLIENT_ID, CLIENT_SECRET, and REDIRECT_URI must be specified as environment variables') return -1blogs = sys.argv[1:] oauth = get_session(client_id, client_secret, redirect_uri) print('='*24) blocks = get_all_blocks(oauth, blogs) to_block = permutate_blocks(blogs, blocks) block_all_blogs(oauth, blogs, to_block) return 0
if name=='main': sys.exit(main())
2 notes
·
View notes
Text
Hey! It's been awhile since I've done a long post. Let me tell you something pretty interesting!
Do you guys know that there's a Discord bots featuring our lads in Love and Deepspace? I've been thirsty for more interactions with my Rafayel so these bots are really a heaven sent!
They are made by chaengcheekies. (https://x.com/chaengcheekies)
The creator made Rafayel, Zayne & Xavier bots. And I hope more guys will be added later!
I instantly downloaded them and been having fun interacting with them. There's a WARNING though. These are NSFW bots. lmao. So the guys will do everything they can to undress you. lol. I'm sure a lot of LaD girlies will like it! So minors, please stay away!
I uploaded here some of my interactions with them. Since I was having my lunch at that time, I'm not really in the mood to get hot and dirty with them, so I was trying my best to stop their advances. And it's kind of funny how they make a simple meal into an alluring one. lol. I wasn't able to get a meal talk with Zayne since I was a bit busy but I scheduled a date with him. hehe. And it's kind of cute.
I also like that they always listen to you. Though they are my first discord bot. I'm not really sure what the usual discord bots do, but I've been having so much fun with them.
If you are interested, go and download them now! And don't forget to thank their hardworking creator chaengcheekies!
Rafayel NSFW Discord Bot: https://discord.com/oauth2/authorize?client_id=1239243364038348880&permissions=67584&scope=bot
Zayne NSFW Discord Bot: https://discord.com/oauth2/authorize?client_id=1219415041992818728&permissions=67584&scope=bot
Xavier NSFW Discord Bot: https://discord.com/oauth2/authorize?client_id=1217969413794562168&permissions=67584&scope=bot
#otome#otome game#loveanddeepspace#love and deepspace#rafayel#homura#xavier#zayne#discord#bot#discord bot
10 notes
·
View notes
Text
How to archive a Discord channel
I'm going to say this way ahead of time: this is going to be waaaaaaay more of an annoying process than it should be. Discord should allow exporting the channel history to server owners, without the need of doing all this. I won't blame you if you give up.
Get the DiscordChatExporter application to download the chat history
This program has two versions
one that has a graphical interface, but works on Windows only
one that has a command line interface, but works on Windows, Linux and macOS
This guide covers the first. The second one maybe next time, in another post. The second version also makes it easier to download every channel on the server.
Step 1: Go to here, and download the latest version in the zip file named DiscordChatExporter.zip
Step 2: Unpack the zip file
Step 3: Run DiscordChatExporter.exe
Step 4: Dismiss the scary looking warning as this will show up for any program that which developer can't afford paying $629 a year.
Step 5: Close the welcoming message and you'll see the application interface:
Prepare an access token. Do not share it to anyone else - treat it the same way as you treat your password.
There are two ways to do it:
Approach 1: use your own access token, will work with any channel you're able to access, including Direct Messages, but it is a violation of Discord Terms of Service, and therefore your Discord account could get banned for it. Use at your own risk.
Follow the instructions here, which are fairly detailed step-by-step instructions for Chrome, Firefox, and also the desktop app. I'm gonna expand more on approach 2 as I had to figure it out myself, and the current instructions for approach 2 are not really adequate enough. If you go with approach 1, skip down the entire section below, until the "Paste the token in the Token textbox and click the arrow button" section.
Approach 2: create a bot account, invite it to your server, and use its access token. This process assumes you have enough privileges to invite bots to the server ("Manage Server" permission), and therefore, but is also 100% okay as far as Discord's Terms of Service are concerned. It is also generally safer, as accidental leaking of the token will not risk you losing your user account.
Step 1: Go to the Discord developer portal.
Step 2: Create a new application by clicking the "New Application" button
Step 3: Name it however you want, I personally named it "mlemgrab". Agree to the scary sounding long ass terms of service.
Step 4: Go to the Bot section, scroll down to the "Privileged Gateway Intents"
Step 5: Enable the "Message Content Intent". We don't have to worry about the "if your bot is in more than 100 servers" part because our bot will never be in this many servers.
Step 6: Save changes by pressing the green button "Save Changes"
Step 7: Go to "OAuth2" followed by "URL Generator"
Step 8: Select the "bot" scope and then "Read Messages/View Channels" and "Read Message History" permissions
Step 9: Copy the link at the bottom and visit it:
Step 10: Press "Continue", and approve the required permissions by clicking Authorize. Once you do it, the bot account is on the server.
Step 11: Go to "Bot" and click the "Reset Token" button to get the token that will allow you to act (in our case, getting all the messages) using the bot user. If you lose that token, you can click reset again to get a new one.
Paste the token in the Token textbox and click the arrow button
Select the server, and then the channel you want to archive
Click the download button on the bottom right
Select where you want to save it, and the format. HTML is good for easy browsing and preview in a web browser, JSON is good for further processing (let's say someone else later writes a program for importing the conversation elsewhere).
For archivization purposes I recommend saving in both HTML and JSON.
Click "More" for more options.
By default the program will not download any message attachments nor avatars or emotes. If you want that, select "Download assets" option. Preferably while also selecting the "Reuse assets" option and selecting a single directory for assets if you want to archive multiple channels.
You can also select the specific time range and using the partition limit - split the archive into several files each containing N messages.
Press Export. Wait. The progress bar will move very slowly.
Once it is done, you should be able to open the HTML file with your web browser.
Treat anything on Discord as media that will be lost
Do not use Discord to host your files. Do not rely on Discord to preserve your text. DO NOT RELY ON DISCORD FOR ANY KIND OF PRESERVATION OR HOSTING!!
It CAN be lost, it WILL be lost! You must consider Discord as a part of the Core Internet, controlled by one company that hosts the servers.
I thought it was impressive at first that it replaced IRC, but now I am horrified. If the company behind Discord went under today, how many friends would you lose?
How many relationships? How much writing?
You may think this won't happen, but I remember when AIM went down and along with it, entire novels worth of interaction with my oldest friend.
IT CAN HAPPEN TO YOU. IT WILL HAPPEN AGAIN. NO COMPANY IS INFALLIBLE.
Back up your files! Download anything you've saved to Discord NOW, before the API changes go into effect! And DO NOT RELY ON THEM FOR HOLDING IMPORTANT FILES!
50K notes
·
View notes