Comments (5)
I think that I missed the setting, thanks for your help!
from line-bot-sdk-java.
Thank you for your feedback.
First, could you give me more detail about your propose?
I think you have to hosting "event callback endpoint" and "public resources" in same server
and want to protect your public resources by Spring Security.
Is it right?
from line-bot-sdk-java.
Yea it is right
from line-bot-sdk-java.
OK but sorry I can't reproduce your issue.
Please be careful you should security.ignored: /callback
.
Could you give me the code to reproduces?
Below is the code for my test.
My java
package com.example.bot.spring.echo;
import java.security.Principal;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.linecorp.bot.model.event.Event;
import com.linecorp.bot.model.event.MessageEvent;
import com.linecorp.bot.model.event.message.TextMessageContent;
import com.linecorp.bot.model.message.TextMessage;
import com.linecorp.bot.spring.boot.annotation.EventMapping;
import com.linecorp.bot.spring.boot.annotation.LineMessageHandler;
import lombok.extern.slf4j.Slf4j;
@SpringBootApplication
@LineMessageHandler
@RestController
@Slf4j
public class EchoApplication extends WebSecurityConfigurerAdapter {
public static void main(String[] args) {
SpringApplication.run(EchoApplication.class, args);
}
@GetMapping("/")
public Object whoami(final Principal principal) {
return principal;
}
@EventMapping
public TextMessage handleTextMessageEvent(
final MessageEvent<TextMessageContent> event) {
return new TextMessage(event.getMessage().getText());
}
@EventMapping
public void handleDefaultMessageEvent(final Event event) {
log.info("Event: {}", event);
}
}
application.yml
line.bot:
channel-secret: MY SECRET
channel-token: MY TOKEN
security:
ignored: /callback
from line-bot-sdk-java.
You are welcome~
from line-bot-sdk-java.
Related Issues (20)
- [Feature Request] Http proxy support in version 7 HOT 7
- [BUG] LineBlobClient UnauthorizedException response HOT 7
- [Question] Line stickers HOT 1
- [Question] version 6.x End of Life Date HOT 1
- [Question] version 6.x End of Life Date continued HOT 2
- [BUG] Line Module Channel unable to attach bot to the line module HOT 1
- [Feature Request] mimeType in BlobContent HOT 1
- Please annotate field @Nullable or @NotNull HOT 8
- [Feature Request] Some enums are missing in v7 HOT 2
- Proposal: Switch from Retrofit2 to OkHttp3 HOT 1
- [Feature Request] Disable the logger "com.linecorp.bot.client.wire" HOT 1
- [BUG] NPE thrown by MessagingApiClientException#getDetails() HOT 2
- Get content transcoding status and a preview image HOT 2
- Get content transcoding status and a preview image HOT 1
- @All in the mention property of the webhooks HOT 2
- [BUG] Cannot resolve method 'getMessageContent' in 'LineMessagingClient' HOT 3
- Time to development 7.x
- Update openapi spec periodically HOT 1
- Release artifacts via github releases HOT 3
- Type name missmatch in openapi code generation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from line-bot-sdk-java.